diff options
Diffstat (limited to 'dhall/src/semantics/core/var.rs')
-rw-r--r-- | dhall/src/semantics/core/var.rs | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/dhall/src/semantics/core/var.rs b/dhall/src/semantics/core/var.rs index 93776bf..b336c66 100644 --- a/dhall/src/semantics/core/var.rs +++ b/dhall/src/semantics/core/var.rs @@ -26,15 +26,9 @@ impl AlphaVar { alpha: self.alpha.shift(delta, &var.alpha)?, }) } - pub(crate) fn under_binder<T>(&self, x: T) -> Self - where - T: Into<AlphaVar>, - { + pub(crate) fn under_binder(&self) -> Self { // Can't fail since delta is positive - self.shift(1, &x.into()).unwrap() - } - pub(crate) fn over_binder(&self, x: &AlphaVar) -> Option<Self> { - self.shift(-1, x) + self.shift(1, &AlphaVar::default()).unwrap() } } @@ -82,17 +76,6 @@ impl std::fmt::Debug for Binder { } } -impl From<Binder> for AlphaVar { - fn from(x: Binder) -> AlphaVar { - AlphaVar { alpha: V((), 0) } - } -} -impl<'a> From<&'a Binder> for AlphaVar { - fn from(x: &'a Binder) -> AlphaVar { - AlphaVar { alpha: V((), 0) } - } -} - impl From<Binder> for Label { fn from(x: Binder) -> Label { x.name |