From 7aaa3f1747e6012e51e67edb268414e2c2fb51cd Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 14 Apr 2019 15:46:52 +0200 Subject: Remove unused ExprF::as_ref --- dhall_core/src/core.rs | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) (limited to 'dhall_core') diff --git a/dhall_core/src/core.rs b/dhall_core/src/core.rs index b3f6b9c..9c07ff7 100644 --- a/dhall_core/src/core.rs +++ b/dhall_core/src/core.rs @@ -284,53 +284,6 @@ impl Expr { } impl ExprF { - pub fn as_ref(&self) -> ExprF<&SE, &L, &N, &E> - where - L: Ord, - { - fn opt(x: &Option) -> Option<&T> { - x.as_ref() - } - fn vec(x: &[T]) -> Vec<&T> { - x.iter().collect() - } - fn btmap(x: &BTreeMap) -> BTreeMap<&L, &SE> { - x.iter().collect() - } - - use crate::ExprF::*; - match self { - Var(V(l, n)) => Var(V(l, *n)), - Lam(l, t, b) => Lam(l, t, b), - Pi(l, t, b) => Pi(l, t, b), - Let(l, t, a, b) => Let(l, opt(t), a, b), - App(f, args) => App(f, vec(args)), - Annot(x, t) => Annot(x, t), - Const(k) => Const(*k), - Builtin(v) => Builtin(*v), - BoolLit(b) => BoolLit(*b), - NaturalLit(n) => NaturalLit(*n), - IntegerLit(n) => IntegerLit(*n), - DoubleLit(n) => DoubleLit(*n), - TextLit(t) => TextLit(t.as_ref()), - BinOp(o, x, y) => BinOp(*o, x, y), - BoolIf(b, t, f) => BoolIf(b, t, f), - EmptyListLit(t) => EmptyListLit(t), - NEListLit(es) => NEListLit(vec(es)), - EmptyOptionalLit(t) => EmptyOptionalLit(t), - NEOptionalLit(e) => NEOptionalLit(e), - RecordType(kts) => RecordType(btmap(kts)), - RecordLit(kvs) => RecordLit(btmap(kvs)), - UnionType(kts) => UnionType(btmap(kts)), - UnionLit(k, v, kvs) => UnionLit(k, v, btmap(kvs)), - Merge(x, y, t) => Merge(x, y, opt(t)), - Field(e, l) => Field(e, l), - Projection(e, ls) => Projection(e, vec(ls)), - Note(n, e) => Note(n, e), - Embed(a) => Embed(a), - } - } - pub fn traverse_ref<'a, SE2, L2, N2, E2, Err, F1, F2, F3, F4, F5>( &'a self, visit_subexpr: F1, -- cgit v1.2.3