mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Reduce Boxing for Apply
This commit is contained in:
parent
9b13df8fd7
commit
55020f6d9f
3 changed files with 3 additions and 3 deletions
|
@ -13,7 +13,7 @@ pub enum Expr {
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
Func(String, Box<Expr>),
|
Func(String, Box<Expr>),
|
||||||
Apply(Box<Expr>, Box<Expr>),
|
Apply(Box<(Expr, Expr)>),
|
||||||
Operator(Box<Expr>, Operator, Box<Expr>),
|
Operator(Box<Expr>, Operator, Box<Expr>),
|
||||||
Closure(Vec<Pattern>, Box<Expr>),
|
Closure(Vec<Pattern>, Box<Expr>),
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,7 @@ where I: Stream<Item = char, Position = IndentablePosition>,
|
||||||
match opt_expr2 {
|
match opt_expr2 {
|
||||||
None => expr1,
|
None => expr1,
|
||||||
Some(expr2) => {
|
Some(expr2) => {
|
||||||
Expr::Apply(Box::new(expr1), Box::new(expr2))
|
Expr::Apply(Box::new((expr1, expr2)))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -363,7 +363,7 @@ mod tests {
|
||||||
|
|
||||||
fn expect_parsed_apply<'a>(parse_str: &'a str, expr1: Expr, expr2: Expr) {
|
fn expect_parsed_apply<'a>(parse_str: &'a str, expr1: Expr, expr2: Expr) {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Ok((Apply(Box::new(expr1), Box::new(expr2)), "")),
|
Ok((Apply(Box::new((expr1, expr2))), "")),
|
||||||
parse_standalone(parse_str)
|
parse_standalone(parse_str)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue