summaryrefslogtreecommitdiff
path: root/dhall_core/src/context.rs
diff options
context:
space:
mode:
authorNadrieril2019-03-08 18:17:22 +0100
committerNadrieril2019-03-08 18:19:47 +0100
commit78a0c10a4595683c034b8d3617f55c88cea2aa3c (patch)
treebfb82c395f6a7f81e650535197665ad419d9e100 /dhall_core/src/context.rs
parent7f9d988a3e0555123030f48f3759216ef2e14ec3 (diff)
Slowly propagate the new type parameter throughout the codebase
Diffstat (limited to 'dhall_core/src/context.rs')
-rw-r--r--dhall_core/src/context.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/dhall_core/src/context.rs b/dhall_core/src/context.rs
index 412d3f0..877843d 100644
--- a/dhall_core/src/context.rs
+++ b/dhall_core/src/context.rs
@@ -31,8 +31,8 @@ impl<K: Hash + Eq + Clone, T> Context<K, T> {
/// lookup k n (insert k v c) = lookup k (n - 1) c -- 1 <= n
/// lookup k n (insert j v c) = lookup k n c -- k /= j
/// ```
- pub fn lookup<'a>(&'a self, k: K, n: usize) -> Option<&'a T> {
- self.0.get(&k).and_then(|v| v.get(v.len() - 1 - n))
+ pub fn lookup<'a>(&'a self, k: &K, n: usize) -> Option<&'a T> {
+ self.0.get(k).and_then(|v| v.get(v.len() - 1 - n))
}
pub fn map<U, F: Fn(&T) -> U>(&self, f: F) -> Context<K, U> {