diff options
author | Nadrieril Feneanar | 2020-03-17 23:36:12 +0000 |
---|---|---|
committer | GitHub | 2020-03-17 23:36:12 +0000 |
commit | 6c18f2b698874d125532625e2bedaa6621962074 (patch) | |
tree | dc8eec542bdbbb39bc24b8b43e1abf20490e6702 /dhall/src/semantics/resolve/hir.rs | |
parent | 681dad33cf27b2be4f4b3cefd83998af1d7eefb2 (diff) | |
parent | 715a941333887c4a29c2c49102bf1455d88a5417 (diff) |
Merge pull request #144 from Nadrieril/clippy
Clippy
Diffstat (limited to '')
-rw-r--r-- | dhall/src/semantics/resolve/hir.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dhall/src/semantics/resolve/hir.rs b/dhall/src/semantics/resolve/hir.rs index 317708a..fa2989f 100644 --- a/dhall/src/semantics/resolve/hir.rs +++ b/dhall/src/semantics/resolve/hir.rs @@ -30,7 +30,7 @@ impl AlphaVar { pub(crate) fn new(idx: usize) -> Self { AlphaVar { idx } } - pub(crate) fn idx(&self) -> usize { + pub(crate) fn idx(self) -> usize { self.idx } } @@ -100,7 +100,7 @@ fn hir_to_expr( ) -> NormalizedExpr { let kind = match hir.kind() { HirKind::Var(v) if opts.alpha => ExprKind::Var(V("_".into(), v.idx())), - HirKind::Var(v) => ExprKind::Var(env.label_var(v)), + HirKind::Var(v) => ExprKind::Var(env.label_var(*v)), HirKind::Import(hir, _) => { return hir_to_expr(hir, opts, &mut NameEnv::new()) } @@ -110,7 +110,7 @@ fn hir_to_expr( env.insert_mut(l); } let e = hir_to_expr(hir, opts, env); - if let Some(_) = l { + if l.is_some() { env.remove_mut(); } e |