about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaqa Ishtyaq <aaqaishtyaq@gmail.com>2023-01-10T16·53+0530
committerclbot <clbot@tvl.fyi>2023-01-10T19·13+0000
commit9382afdb0d7258cee8e7f20d646a85076f38011a (patch)
treed7eeb9d8679793aa7b13863993c78787881b0cea
parent88f95030571cd2b12ca6c0efb5e63a11f53a35a9 (diff)
fix(tvix/eval): address useless_format clippy warn r/5642
This CL address clippy warnings related to use of 'format!' macro
to return unmodified 'String'.

Change-Id: I88726e59d8f39f6a455a8c1f48075b52d167e489
Signed-off-by: Aaqa Ishtyaq <aaqaishtyaq@gmail.com>
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7804
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
-rw-r--r--tvix/eval/src/warnings.rs19
1 files changed, 6 insertions, 13 deletions
diff --git a/tvix/eval/src/warnings.rs b/tvix/eval/src/warnings.rs
index 26efd24d1e..5395fc20b9 100644
--- a/tvix/eval/src/warnings.rs
+++ b/tvix/eval/src/warnings.rs
@@ -68,7 +68,8 @@ impl EvalWarning {
             }
 
             WarningKind::UselessInherit => {
-                format!("inherit does nothing (this variable already exists with the same value)")
+                "inherit does nothing (this variable already exists with the same value)"
+                    .to_string()
             }
 
             WarningKind::UnusedBinding => {
@@ -94,21 +95,13 @@ impl EvalWarning {
                 format!("useless operation on boolean: {}", msg)
             }
 
-            WarningKind::DeadCode => {
-                format!("this code will never be executed")
-            }
+            WarningKind::DeadCode => "this code will never be executed".to_string(),
 
-            WarningKind::EmptyInherit => {
-                format!("this `inherit` statement is empty")
-            }
+            WarningKind::EmptyInherit => "this `inherit` statement is empty".to_string(),
 
-            WarningKind::EmptyLet => {
-                format!("this `let`-expression contains no bindings")
-            }
+            WarningKind::EmptyLet => "this `let`-expression contains no bindings".to_string(),
 
-            WarningKind::UselessParens => {
-                format!("these parenthesis can be removed")
-            }
+            WarningKind::UselessParens => "these parenthesis can be removed".to_string(),
 
             WarningKind::NotImplemented(what) => {
                 format!("feature not yet implemented in tvix: {}", what)