about summary refs log tree commit diff
path: root/tvix/eval/src/compiler
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-12-20T14·22+0300
committerclbot <clbot@tvl.fyi>2022-12-25T18·25+0000
commit71174f6626cbf100a8428ddc334681e4edfb45e6 (patch)
tree1e803137d755001700f0e900aa5173bbf43fdf3f /tvix/eval/src/compiler
parent67d508f2ece710714ce8abf6f7deba1fd2440487 (diff)
fix(tvix/eval): fix current clippy warnings r/5486
It's been a while since the last time, so quite a lot of stuff has
accumulated here.

Change-Id: I0762827c197b30a917ff470fd8ae8f220f6ba247
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7597
Reviewed-by: grfn <grfn@gws.fyi>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/compiler')
-rw-r--r--tvix/eval/src/compiler/bindings.rs3
-rw-r--r--tvix/eval/src/compiler/mod.rs6
2 files changed, 4 insertions, 5 deletions
diff --git a/tvix/eval/src/compiler/bindings.rs b/tvix/eval/src/compiler/bindings.rs
index 31ab76aee8..12eaae5c19 100644
--- a/tvix/eval/src/compiler/bindings.rs
+++ b/tvix/eval/src/compiler/bindings.rs
@@ -804,7 +804,7 @@ impl Compiler<'_> {
         }
 
         if let Some(ast::InterpolPart::Literal(lit)) = parts.pop() {
-            return Some(SmolStr::new(&lit));
+            return Some(SmolStr::new(lit));
         }
 
         None
@@ -812,7 +812,6 @@ impl Compiler<'_> {
 
     /// Convert the provided `ast::Attr` into a statically known string if
     /// possible.
-    // TODO(tazjin): these should probably be SmolStr
     fn expr_static_attr_str(&self, node: &ast::Attr) -> Option<SmolStr> {
         match node {
             ast::Attr::Ident(ident) => Some(ident.ident_token().unwrap().text().into()),
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs
index ae31d27145..12fd269c2f 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -558,7 +558,7 @@ impl Compiler<'_> {
                 self.emit_force(s);
             }
 
-            ast::Attr::Ident(ident) => self.emit_literal_ident(&ident),
+            ast::Attr::Ident(ident) => self.emit_literal_ident(ident),
         }
     }
 
@@ -1232,7 +1232,7 @@ pub fn compile(
 
     let root_span = c.span_for(expr);
     let root_slot = c.scope_mut().declare_phantom(root_span, false);
-    c.compile(root_slot, &expr);
+    c.compile(root_slot, expr);
 
     // The final operation of any top-level Nix program must always be
     // `OpForce`. A thunk should not be returned to the user in an
@@ -1247,6 +1247,6 @@ pub fn compile(
         lambda,
         warnings: c.warnings,
         errors: c.errors,
-        globals: globals,
+        globals,
     })
 }