From da55a72717b247444a31b1932f85ce4abec03c14 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 30 Jan 2020 14:17:50 +0000 Subject: Tweak --- dhall/src/semantics/core/value.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'dhall/src/semantics') diff --git a/dhall/src/semantics/core/value.rs b/dhall/src/semantics/core/value.rs index f6d273c..e69d220 100644 --- a/dhall/src/semantics/core/value.rs +++ b/dhall/src/semantics/core/value.rs @@ -338,11 +338,7 @@ impl Value { )) } self_kind => { - let self_kind = self_kind - .map_ref_with_special_handling_of_binders( - |v| v.to_tyexpr(venv), - |_, _, v| v.to_tyexpr(venv.insert()), - ); + let self_kind = self_kind.map_ref(|v| v.to_tyexpr(venv)); let expr = match self_kind { ValueKind::Var(..) | ValueKind::LamClosure { .. } @@ -537,7 +533,7 @@ impl ValueKind { } impl ValueKind { - pub(crate) fn traverse_ref_with_special_handling_of_binders<'a, V2, E>( + fn traverse_ref_with_special_handling_of_binders<'a, V2, E>( &'a self, visit_val: impl FnMut(&'a V) -> Result, visit_under_binder: impl for<'b> FnMut( @@ -555,7 +551,7 @@ impl ValueKind { .visit(self) } - pub(crate) fn map_ref_with_special_handling_of_binders<'a, V2>( + fn map_ref_with_special_handling_of_binders<'a, V2>( &'a self, mut map_val: impl FnMut(&'a V) -> V2, mut map_under_binder: impl for<'b> FnMut(&'a Binder, &'b V, &'a V) -> V2, @@ -567,8 +563,7 @@ impl ValueKind { )) } - #[allow(dead_code)] - pub(crate) fn map_ref<'a, V2>( + fn map_ref<'a, V2>( &'a self, map_val: impl Fn(&'a V) -> V2, ) -> ValueKind { -- cgit v1.2.3