From 250525a05e1af17bb46ceb72879f471e54fb5091 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 2 Sep 2019 23:07:12 +0200 Subject: No need to change the type of Embed when resolving anymore --- dhall_syntax/src/core/expr.rs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'dhall_syntax/src/core/expr.rs') diff --git a/dhall_syntax/src/core/expr.rs b/dhall_syntax/src/core/expr.rs index eeee4d8..f46cafb 100644 --- a/dhall_syntax/src/core/expr.rs +++ b/dhall_syntax/src/core/expr.rs @@ -313,21 +313,25 @@ impl ExprF { } impl RawExpr { - pub fn traverse_resolve( + pub fn traverse_resolve( &self, - visit_import: impl FnMut(&Import>) -> Result, - ) -> Result, Err> { + visit_import: impl FnMut(&Import>) -> Result, + ) -> Result, Err> + where + E: Clone, + { self.traverse_resolve_with_visitor(&mut visitor::ResolveVisitor( visit_import, )) } - pub(crate) fn traverse_resolve_with_visitor( + pub(crate) fn traverse_resolve_with_visitor( &self, visitor: &mut visitor::ResolveVisitor, - ) -> Result, Err> + ) -> Result, Err> where - F1: FnMut(&Import>) -> Result, + E: Clone, + F1: FnMut(&Import>) -> Result, { match self { ExprF::BinOp(BinOp::ImportAlt, l, r) => l @@ -368,10 +372,13 @@ impl Expr { } impl Expr { - pub fn traverse_resolve( + pub fn traverse_resolve( &self, - visit_import: impl FnMut(&Import>) -> Result, - ) -> Result, Err> { + visit_import: impl FnMut(&Import>) -> Result, + ) -> Result, Err> + where + E: Clone, + { Ok(self.rewrap(self.as_ref().traverse_resolve(visit_import)?)) } } -- cgit v1.2.3