diff options
author | Nadrieril | 2019-12-22 19:14:29 +0000 |
---|---|---|
committer | Nadrieril | 2019-12-22 19:14:29 +0000 |
commit | 5536fe26187952a51087416ddd294d1da1ec689d (patch) | |
tree | 0a1590eff5e811fd874b02400d5a8a8ee8fba19d /dhall/src/syntax | |
parent | a775c2c1019c1c2c21bf09cf10ca8e3916462bb8 (diff) |
rustfmt
Diffstat (limited to 'dhall/src/syntax')
-rw-r--r-- | dhall/src/syntax/binary/encode.rs | 4 | ||||
-rw-r--r-- | dhall/src/syntax/text/printer.rs | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/dhall/src/syntax/binary/encode.rs b/dhall/src/syntax/binary/encode.rs index 867fc9c..5e79f2d 100644 --- a/dhall/src/syntax/binary/encode.rs +++ b/dhall/src/syntax/binary/encode.rs @@ -164,9 +164,7 @@ where ProjectionByExpr(x, y) => { ser_seq!(ser; tag(10), expr(x), vec![expr(y)]) } - Completion(x, y) => { - ser_seq!(ser; tag(3), tag(13), expr(x), expr(y)) - } + Completion(x, y) => ser_seq!(ser; tag(3), tag(13), expr(x), expr(y)), Import(import) => serialize_import(ser, import), Embed(_) => unimplemented!( "An expression with resolved imports cannot be binary-encoded" diff --git a/dhall/src/syntax/text/printer.rs b/dhall/src/syntax/text/printer.rs index 759e7e6..626ab1c 100644 --- a/dhall/src/syntax/text/printer.rs +++ b/dhall/src/syntax/text/printer.rs @@ -64,7 +64,9 @@ impl<E: Display + Clone> UnspannedExpr<E> { Field(a, b) => Field(a.phase(Primitive), b), Projection(e, ls) => Projection(e.phase(Primitive), ls), ProjectionByExpr(a, b) => ProjectionByExpr(a.phase(Primitive), b), - Completion(a, b) => Completion(a.phase(Primitive), b.phase(Primitive)), + Completion(a, b) => { + Completion(a.phase(Primitive), b.phase(Primitive)) + } e => e, } } @@ -90,9 +92,10 @@ impl<E: Display + Clone> UnspannedExpr<E> { // Precedence is magically handled by the ordering of BinOps. ExprKind::BinOp(op, _, _) => phase > PrintPhase::BinOp(*op), ExprKind::App(_, _) => phase > PrintPhase::App, - Field(_, _) | Projection(_, _) | ProjectionByExpr(_, _) | Completion(_, _) => { - phase > PrintPhase::Import - } + Field(_, _) + | Projection(_, _) + | ProjectionByExpr(_, _) + | Completion(_, _) => phase > PrintPhase::Import, _ => false, }; |