Make pattern_symbols be a slice

This commit is contained in:
Richard Feldman 2020-08-08 21:54:16 -04:00
parent 4acb9fa325
commit 0f8906b6d3
2 changed files with 4 additions and 4 deletions

View File

@ -202,7 +202,7 @@ pub fn gen(
let proc = PartialProc {
annotation: def.expr_var,
// This is a 0-arity thunk, so it has no arguments.
pattern_symbols: bumpalo::collections::Vec::new_in(arena),
pattern_symbols: &[],
body,
};

View File

@ -15,7 +15,7 @@ use std::collections::HashMap;
#[derive(Clone, Debug, PartialEq)]
pub struct PartialProc<'a> {
pub annotation: Variable,
pub pattern_symbols: Vec<'a, Symbol>,
pub pattern_symbols: &'a [Symbol],
pub body: roc_can::expr::Expr,
}
@ -426,7 +426,7 @@ fn patterns_to_when<'a>(
) -> Result<
(
Vec<'a, Variable>,
Vec<'a, Symbol>,
&'a [Symbol],
Located<roc_can::expr::Expr>,
),
Located<RuntimeError>,
@ -483,7 +483,7 @@ fn patterns_to_when<'a>(
}
match body {
Ok(body) => Ok((arg_vars, symbols, body)),
Ok(body) => Ok((arg_vars, symbols.into_bump_slice(), body)),
Err(loc_error) => Err(loc_error),
}
}