diff options
author | Nadrieril | 2019-04-19 14:42:36 +0200 |
---|---|---|
committer | Nadrieril | 2019-04-19 14:42:36 +0200 |
commit | 4bed7b11e227a3151a2ff9e74f9662c126aad5a4 (patch) | |
tree | 789479787c3652d9adce1511a37fbee69d9a73a7 /dhall_core/src/printer.rs | |
parent | 759705047eea74f538883c15b6abd3292bbebb13 (diff) |
Make App() only store one argument
Diffstat (limited to 'dhall_core/src/printer.rs')
-rw-r--r-- | dhall_core/src/printer.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/dhall_core/src/printer.rs b/dhall_core/src/printer.rs index 4d1ae2d..85105d9 100644 --- a/dhall_core/src/printer.rs +++ b/dhall_core/src/printer.rs @@ -56,12 +56,8 @@ impl<SE: Display + Clone, N, E: Display> Display for ExprF<SE, Label, N, E> { ExprF::BinOp(op, a, b) => { write!(f, "{} {} {}", a, op, b)?; } - ExprF::App(a, args) => { - a.fmt(f)?; - for x in args { - f.write_str(" ")?; - x.fmt(f)?; - } + ExprF::App(a, b) => { + write!(f, "{} {}", a, b)?; } Field(a, b) => { write!(f, "{}.{}", a, b)?; @@ -216,10 +212,7 @@ impl<S: Clone, A: Display + Clone> Expr<S, A> { OldOptionalLit(x, t) => OldOptionalLit(x, t.phase(Import)), EmptyOptionalLit(t) => EmptyOptionalLit(t.phase(Import)), NEOptionalLit(e) => NEOptionalLit(e.phase(Import)), - ExprF::App(a, args) => ExprF::App( - a.phase(Import), - args.into_iter().map(|x| x.phase(Import)).collect(), - ), + ExprF::App(f, a) => ExprF::App(f.phase(Import), a.phase(Import)), Field(a, b) => Field(a.phase(Primitive), b), Projection(e, ls) => Projection(e.phase(Primitive), ls), Note(n, b) => Note(n, b.phase(phase)), |