about summary refs log tree commit diff
path: root/tvix/eval/builtin-macros
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-11-05T17·31+0300
committerclbot <clbot@tvl.fyi>2023-11-05T20·28+0000
commitb3b1f649d613c97a196528b1210dd5b914995c14 (patch)
tree7ec2a8190c8086325a7962ff74685c88954b91c3 /tvix/eval/builtin-macros
parent67999f0dcf715962b8f56c9bfd8c5c403213cb02 (diff)
chore(tvix): fix trivial clippy lints r/6955
Relates to b/321.

Change-Id: I37284f89b186e469eb432e2bbedb37aa125a6ad4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9961
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/builtin-macros')
-rw-r--r--tvix/eval/builtin-macros/src/lib.rs4
-rw-r--r--tvix/eval/builtin-macros/tests/tests.rs6
2 files changed, 5 insertions, 5 deletions
diff --git a/tvix/eval/builtin-macros/src/lib.rs b/tvix/eval/builtin-macros/src/lib.rs
index e2cd51b92451..de73b4576a0c 100644
--- a/tvix/eval/builtin-macros/src/lib.rs
+++ b/tvix/eval/builtin-macros/src/lib.rs
@@ -81,7 +81,7 @@ fn parse_module_args(args: TokenStream) -> Option<Type> {
         _ => panic!("arguments to `builtins`-attribute must be of the form `name = value`"),
     };
 
-    if name_value.path.get_ident().unwrap().to_string() != "state" {
+    if *name_value.path.get_ident().unwrap() != "state" {
         return None;
     }
 
@@ -182,7 +182,7 @@ pub fn builtins(args: TokenStream, item: TokenStream) -> TokenStream {
                 let mut captures_state = false;
                 if let FnArg::Typed(PatType { pat, .. }) = &f.sig.inputs[0] {
                     if let Pat::Ident(PatIdent { ident, .. }) = pat.as_ref() {
-                        if ident.to_string() == "state" {
+                        if *ident == "state" {
                             if state_type.is_none() {
                                 panic!("builtin captures a `state` argument, but no state type was defined");
                             }
diff --git a/tvix/eval/builtin-macros/tests/tests.rs b/tvix/eval/builtin-macros/tests/tests.rs
index 735ff4672007..4713743e5295 100644
--- a/tvix/eval/builtin-macros/tests/tests.rs
+++ b/tvix/eval/builtin-macros/tests/tests.rs
@@ -3,7 +3,7 @@ use tvix_eval_builtin_macros::builtins;
 
 #[builtins]
 mod builtins {
-    use tvix_eval::generators::{self, Gen, GenCo};
+    use tvix_eval::generators::{Gen, GenCo};
     use tvix_eval::{ErrorKind, Value};
 
     /// Test docstring.
@@ -11,12 +11,12 @@ mod builtins {
     /// It has multiple lines!
     #[builtin("identity")]
     pub async fn builtin_identity(co: GenCo, x: Value) -> Result<Value, ErrorKind> {
-        Ok(todo!())
+        Ok(x)
     }
 
     #[builtin("tryEval")]
     pub async fn builtin_try_eval(co: GenCo, #[lazy] _x: Value) -> Result<Value, ErrorKind> {
-        todo!()
+        unimplemented!("builtin is never called")
     }
 }