From 1522469dc0b68c63dbbc81faab057c3d48402657 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 15 Mar 2019 23:46:37 +0100 Subject: rustfmt --- dhall/src/normalize.rs | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'dhall') diff --git a/dhall/src/normalize.rs b/dhall/src/normalize.rs index ca261e1..5349c9e 100644 --- a/dhall/src/normalize.rs +++ b/dhall/src/normalize.rs @@ -71,17 +71,15 @@ where (ListBuild, [a0, g]) => { // fold/build fusion let g = match g { - App(f, args) => { - match (&**f, args.as_slice()) { - (Builtin(ListFold), [_, x, rest..]) => { - return normalize_whnf(&App( - bx(x.clone()), - rest.to_vec(), - )) - } - (f, args) => app(f.clone(), args.to_vec()), + App(f, args) => match (&**f, args.as_slice()) { + (Builtin(ListFold), [_, x, rest..]) => { + return normalize_whnf(&App( + bx(x.clone()), + rest.to_vec(), + )) } - } + (f, args) => app(f.clone(), args.to_vec()), + }, g => g.clone(), }; let g = bx(g); @@ -94,17 +92,15 @@ where (OptionalBuild, [a0, g]) => { // fold/build fusion let g = match g { - App(f, args) => { - match (&**f, args.as_slice()) { - (Builtin(OptionalFold), [_, x, rest..]) => { - return normalize_whnf(&App( - bx(x.clone()), - rest.to_vec(), - )) - } - (f, args) => app(f.clone(), args.to_vec()), + App(f, args) => match (&**f, args.as_slice()) { + (Builtin(OptionalFold), [_, x, rest..]) => { + return normalize_whnf(&App( + bx(x.clone()), + rest.to_vec(), + )) } - } + (f, args) => app(f.clone(), args.to_vec()), + }, g => g.clone(), }; let g = bx(g); @@ -146,9 +142,10 @@ where (Builtin(NaturalFold), [x, rest..]) => { normalize_whnf(&App(bx(x.clone()), rest.to_vec())) } - (f, args) => { - app(Builtin(NaturalBuild), vec![app(f.clone(), args.to_vec())]) - } + (f, args) => app( + Builtin(NaturalBuild), + vec![app(f.clone(), args.to_vec())], + ), } } (NaturalFold, [App(f, args)]) => { @@ -157,9 +154,10 @@ where (Builtin(NaturalBuild), [x, rest..]) => { normalize_whnf(&App(bx(x.clone()), rest.to_vec())) } - (f, args) => { - app(Builtin(NaturalFold), vec![app(f.clone(), args.to_vec())]) - } + (f, args) => app( + Builtin(NaturalFold), + vec![app(f.clone(), args.to_vec())], + ), } } (b, args) => App(bx(Builtin(b)), args.to_vec()), -- cgit v1.2.3