summaryrefslogtreecommitdiff
path: root/dhall/src/syntax
diff options
context:
space:
mode:
authorNadrieril2020-01-17 18:42:13 +0000
committerNadrieril2020-01-17 18:42:13 +0000
commit0f4a4801ed67826dc82015d39ce8fd05e7950035 (patch)
treef8393bb9e8abaccc8db0e1c17ae1d1a39b88ff7b /dhall/src/syntax
parentab672506fd45e33f60b1b962c4757f912b6e27be (diff)
Replace all bulk shifting by a single shift
Diffstat (limited to '')
-rw-r--r--dhall/src/syntax/ast/expr.rs26
1 files changed, 0 insertions, 26 deletions
diff --git a/dhall/src/syntax/ast/expr.rs b/dhall/src/syntax/ast/expr.rs
index 2372b0a..170cbe7 100644
--- a/dhall/src/syntax/ast/expr.rs
+++ b/dhall/src/syntax/ast/expr.rs
@@ -1,5 +1,3 @@
-use std::collections::HashMap;
-
use crate::syntax::map::{DupTreeMap, DupTreeSet};
use crate::syntax::visitor::{self, ExprKindMutVisitor, ExprKindVisitor};
use crate::syntax::*;
@@ -319,30 +317,6 @@ impl<Label: PartialEq + Clone> V<Label> {
}
}
-impl V<Label> {
- pub(crate) fn under_multiple_binders(
- &self,
- shift_map: &HashMap<Label, usize>,
- ) -> Self {
- let name = &self.0;
- let idx = self.1 + shift_map.get(name).unwrap_or(&0);
- V(name.clone(), idx)
- }
-}
-
-impl V<()> {
- pub(crate) fn under_multiple_binders(
- &self,
- shift_map: &HashMap<Label, usize>,
- ) -> Self {
- let mut idx = self.1;
- for (_, n) in shift_map {
- idx += n;
- }
- V((), idx)
- }
-}
-
pub fn trivial_result<T>(x: Result<T, !>) -> T {
match x {
Ok(x) => x,