From 5895c3aa6552f75d7e5202be561f9734fe8945e7 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 13 Aug 2019 19:31:23 +0200 Subject: No need to track the absence of `Span`s at the type level --- dhall/src/phase/binary.rs | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) (limited to 'dhall/src/phase/binary.rs') diff --git a/dhall/src/phase/binary.rs b/dhall/src/phase/binary.rs index f4a9cc1..3292617 100644 --- a/dhall/src/phase/binary.rs +++ b/dhall/src/phase/binary.rs @@ -631,14 +631,12 @@ where ImportLocation::Remote(url) => { match &url.headers { None => ser_seq.serialize_element(&Null)?, - Some(location_hashed) => { - ser_seq.serialize_element(&self::Serialize::Expr( - &SubExpr::from_expr_no_note(ExprF::Embed(Import { - mode: ImportMode::Code, - location_hashed: location_hashed.as_ref().clone(), - })), - ))? - } + Some(location_hashed) => ser_seq.serialize_element( + &self::Serialize::Expr(&rc(ExprF::Embed(Import { + mode: ImportMode::Code, + location_hashed: location_hashed.as_ref().clone(), + }))), + )?, }; ser_seq.serialize_element(&url.authority)?; for p in &url.path { @@ -689,13 +687,13 @@ impl<'a> serde::ser::Serialize for Serialize<'a> { } } -fn collect_nested_applications<'a, N, E>( - e: &'a SubExpr, -) -> (&'a SubExpr, Vec<&'a SubExpr>) { - fn go<'a, N, E>( - e: &'a SubExpr, - vec: &mut Vec<&'a SubExpr>, - ) -> &'a SubExpr { +fn collect_nested_applications<'a, E>( + e: &'a SubExpr, +) -> (&'a SubExpr, Vec<&'a SubExpr>) { + fn go<'a, E>( + e: &'a SubExpr, + vec: &mut Vec<&'a SubExpr>, + ) -> &'a SubExpr { match e.as_ref() { ExprF::App(f, a) => { vec.push(a); @@ -709,16 +707,15 @@ fn collect_nested_applications<'a, N, E>( (e, vec) } -type LetBinding<'a, N, E> = - (&'a Label, &'a Option>, &'a SubExpr); +type LetBinding<'a, E> = (&'a Label, &'a Option>, &'a SubExpr); -fn collect_nested_lets<'a, N, E>( - e: &'a SubExpr, -) -> (&'a SubExpr, Vec>) { - fn go<'a, N, E>( - e: &'a SubExpr, - vec: &mut Vec>, - ) -> &'a SubExpr { +fn collect_nested_lets<'a, E>( + e: &'a SubExpr, +) -> (&'a SubExpr, Vec>) { + fn go<'a, E>( + e: &'a SubExpr, + vec: &mut Vec>, + ) -> &'a SubExpr { match e.as_ref() { ExprF::Let(l, t, v, e) => { vec.push((l, t, v)); -- cgit v1.2.3