about summary refs log tree commit diff
path: root/tvix/eval/src/compiler
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-25T15·39+0300
committertazjin <tazjin@tvl.su>2022-09-03T00·47+0000
commitedee8eecdf706803d3182a4a427c33ba33c71db1 (patch)
treea87d66253160c1b53d086c6ab5779d3d5a7794dd /tvix/eval/src/compiler
parent39b01c302937fe3e91c15758b520c3ecc5379c7b (diff)
fix(tvix/eval): address all current clippy lints r/4608
Change-Id: I758fc4f3b9078de7ca6228a75a4351c3e085c4cf
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6272
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/compiler')
-rw-r--r--tvix/eval/src/compiler/mod.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs
index 7b92b8a099c2..faf67135ed62 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -424,15 +424,14 @@ impl Compiler {
     fn compile_has_attr(&mut self, node: ast::HasAttr) {
         // Put the attribute set on the stack.
         self.compile(node.expr().unwrap());
-        let mut count = 0;
 
         // Push all path fragments with an operation for fetching the
         // next nested element, for all fragments except the last one.
-        for fragment in node.attrpath().unwrap().attrs() {
+        for (count, fragment) in node.attrpath().unwrap().attrs().enumerate() {
             if count > 0 {
                 self.chunk().push_op(OpCode::OpAttrOrNotFound);
             }
-            count += 1;
+
             self.compile_attr(fragment);
         }
 
@@ -950,7 +949,7 @@ impl Compiler {
 
         self.scope_mut().locals.push(Local {
             depth,
-            name: name.into(),
+            name,
             node: Some(node),
             phantom: false,
             used: false,