summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/tck/env.rs
diff options
context:
space:
mode:
authorNadrieril Feneanar2020-03-17 23:36:12 +0000
committerGitHub2020-03-17 23:36:12 +0000
commit6c18f2b698874d125532625e2bedaa6621962074 (patch)
treedc8eec542bdbbb39bc24b8b43e1abf20490e6702 /dhall/src/semantics/tck/env.rs
parent681dad33cf27b2be4f4b3cefd83998af1d7eefb2 (diff)
parent715a941333887c4a29c2c49102bf1455d88a5417 (diff)
Merge pull request #144 from Nadrieril/clippy
Clippy
Diffstat (limited to 'dhall/src/semantics/tck/env.rs')
-rw-r--r--dhall/src/semantics/tck/env.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/dhall/src/semantics/tck/env.rs b/dhall/src/semantics/tck/env.rs
index 17b3cfe..6dd5076 100644
--- a/dhall/src/semantics/tck/env.rs
+++ b/dhall/src/semantics/tck/env.rs
@@ -21,18 +21,18 @@ impl VarEnv {
pub fn from_size(size: usize) -> Self {
VarEnv { size }
}
- pub fn size(&self) -> usize {
+ pub fn size(self) -> usize {
self.size
}
- pub fn insert(&self) -> Self {
+ pub fn insert(self) -> Self {
VarEnv {
size: self.size + 1,
}
}
- pub fn lookup(&self, var: &NzVar) -> AlphaVar {
+ pub fn lookup(self, var: NzVar) -> AlphaVar {
self.lookup_fallible(var).unwrap()
}
- pub fn lookup_fallible(&self, var: &NzVar) -> Option<AlphaVar> {
+ pub fn lookup_fallible(self, var: NzVar) -> Option<AlphaVar> {
let idx = self.size.checked_sub(var.idx() + 1)?;
Some(AlphaVar::new(idx))
}
@@ -67,8 +67,8 @@ impl TyEnv {
items: self.items.insert_value(e, ty),
}
}
- pub fn lookup(&self, var: &AlphaVar) -> Type {
- self.items.lookup_ty(&var)
+ pub fn lookup(&self, var: AlphaVar) -> Type {
+ self.items.lookup_ty(var)
}
}