Repository: biomejs/biome (language: rust)

Issue:
📎 Some statements can be simplified for readability
### Description

We can replace lines like

```rust
let suppression_comment = format!("# {}: {}", suppression_text, suppression_reason);
```

with

```rust
let suppression_comment = format!("# {suppression_text}: {suppression_reason}");
```

to improve code readability and maintainability.


Discussion / hints:

Fix patch:
diff --git a/crates/biome_cli/src/service/unix.rs b/crates/biome_cli/src/service/unix.rs
index 4b77dde6d539..4638872f5cb2 100644
--- a/crates/biome_cli/src/service/unix.rs
+++ b/crates/biome_cli/src/service/unix.rs
@@ -76,7 +76,7 @@ fn spawn_daemon(
     }
 
     if let Some(log_file_name_prefix) = log_file_name_prefix {
-        cmd.arg(format!("--log-prefix-name={}", log_file_name_prefix));
+        cmd.arg(format!("--log-prefix-name={log_file_name_prefix}"));
     }
 
     // Create a new session for the process and make it the leader, this will
diff --git a/crates/biome_css_analyze/src/suppression_action.rs b/crates/biome_css_analyze/src/suppression_action.rs
index 40025ca101e7..fb309aee9ddc 100644
--- a/crates/biome_css_analyze/src/suppression_action.rs
+++ b/crates/biome_css_analyze/src/suppression_action.rs
@@ -59,12 +59,12 @@ impl SuppressionAction for CssSuppressionAction {
             new_token = new_token.with_trailing_trivia([
                 (
                     TriviaPieceKind::SingleLineComment,
-                    format!("/* {}: {} */", suppression_text, suppression_reason).as_str(),
+                    format!("/* {suppression_text}: {suppression_reason} */").as_str(),
                 ),
                 (TriviaPieceKind::Newline, "\n"),
             ]);
         } else if has_leading_whitespace {
-            let suppression_comment = format!("/* {}: {} */", suppression_text, suppression_reason);
+            let suppression_comment = format!("/* {suppression_text}: {suppression_reason} */");
             let mut trivia = vec![
                 (
                     TriviaPieceKind::SingleLineComment,
@@ -86,7 +86,7 @@ impl SuppressionAction for CssSuppressionAction {
             new_token = new_token.with_leading_trivia([
                 (
                     TriviaPieceKind::SingleLineComment,
-                    format!("/* {}: {} */", suppression_text, suppression_reason).as_str(),
+                    format!("/* {suppression_text}: {suppression_reason} */").as_str(),
                 ),
                 (TriviaPieceKind::Newline, "\n"),
             ]);
diff --git a/crates/biome_css_formatter/src/utils/string_utils.rs b/crates/biome_css_formatter/src/utils/string_utils.rs
index a545f320d92a..d04436b730bd 100644
--- a/crates/biome_css_formatter/src/utils/string_utils.rs
+++ b/crates/biome_css_formatter/src/utils/string_utils.rs
@@ -289,10 +289,7 @@ impl<'token> LiteralStringNormaliser<'token> {
             Cow::Borrowed(original)
         } else {
             Cow::Owned(std::format!(
-                "{}{}{}",
-                preferred_quote,
-                content_to_use,
-                preferred_quote,
+                "{preferred_quote}{content_to_use}{preferred_quote}",
             ))
         }
     }
diff --git a/crates/biome_graphql_analyze/src/suppression_action.rs b/crates/biome_graphql_analyze/src/suppression_action.rs
index bb6da195ec9d..34f7c81acb4f 100644
--- a/crates/biome_graphql_analyze/src/suppression_action.rs
+++ b/crates/biome_graphql_analyze/src/suppression_action.rs
@@ -53,7 +53,7 @@ impl SuppressionAction for GraphqlSuppressionAction {
             .filter(|trivia| trivia.is_whitespace())
             .collect();
 
-        let suppression_comment = format!("# {}: {}", suppression_text, suppression_reason);
+        let suppression_comment = format!("# {suppression_text}: {suppression_reason}");
         let suppression_comment = suppression_comment.as_str();
         let trivia = [
             (TriviaPieceKind::SingleLineComment, suppression_comment),
diff --git a/crates/biome_grit_patterns/src/grit_resolved_pattern.rs b/crates/biome_grit_patterns/src/grit_resolved_pattern.rs
index 7ca1a79332cd..e5bef8777c30 100644
--- a/crates/biome_grit_patterns/src/grit_resolved_pattern.rs
+++ b/crates/biome_grit_patterns/src/grit_resolved_pattern.rs
@@ -170,8 +170,7 @@ impl<'a> ResolvedPattern<'a, GritQueryContext> for GritResolvedPattern<'a> {
                     Self::from_pattern(pattern, state, context, logs)
                 } else {
                     return Err(GritPatternError::new(format!(
-                        "cannot create resolved snippet from unresolved variable {}",
-                        name
+                        "cannot create resolved snippet from unresolved variable {name}"
                     )));
                 }
             }
@@ -264,8 +263,7 @@ impl<'a> ResolvedPattern<'a, GritQueryContext> for GritResolvedPattern<'a> {
                     Self::from_pattern(pattern, state, context, logs)
                 } else {
                     return Err(GritPatternError::new(format!(
-                        "cannot create resolved snippet from unresolved variable {}",
-                        name
+                        "cannot create resolved snippet from unresolved variable {name}"
                     )));
                 }
             }
diff --git a/crates/biome_js_analyze/src/assists/source/organize_imports/util.rs b/crates/biome_js_analyze/src/assists/source/organize_imports/util.rs
index 902a590cef4e..223ea4718796 100644
--- a/crates/biome_js_analyze/src/assists/source/organize_imports/util.rs
+++ b/crates/biome_js_analyze/src/assists/source/organize_imports/util.rs
@@ -374,7 +374,7 @@ mod test {
         ];
         for items in sorted.windows(2) {
             let (x, y) = (&items[0], &items[1]);
-            assert!(x < y, "'{:?}' < '{:?}'", x, y);
+            assert!(x < y, "'{x:?}' < '{y:?}'");
         }
     }
 }
diff --git a/crates/biome_js_analyze/src/lint/nursery/use_at_index.rs b/crates/biome_js_analyze/src/lint/nursery/use_at_index.rs
index 37a60b9a8567..1bef002904f5 100644
--- a/crates/biome_js_analyze/src/lint/nursery/use_at_index.rs
+++ b/crates/biome_js_analyze/src/lint/nursery/use_at_index.rs
@@ -229,10 +229,10 @@ impl ErrorType {
                 };
                 let (method, old_method) = match (arg_type, extract_type) {
                     (SliceArgType::OneArg, SliceExtractType::Pop) => {
-                        ("X.at(-1)", format!("X.slice(-a){}", extract_string))
+                        ("X.at(-1)", format!("X.slice(-a){extract_string}"))
                     }
                     (SliceArgType::TwoArg, SliceExtractType::Pop) => {
-                        ("X.at(Y - 1)", format!("X.slice(a, Y){}", extract_string))
+                        ("X.at(Y - 1)", format!("X.slice(a, Y){extract_string}"))
                     }
                     _ => (
                         "X.at(Y)",
diff --git a/crates/biome_js_analyze/src/lint/nursery/use_trim_start_end.rs b/crates/biome_js_analyze/src/lint/nursery/use_trim_start_end.rs
index 41ef6e3ea45d..7eedceaafb47 100644
--- a/crates/biome_js_analyze/src/lint/nursery/use_trim_start_end.rs
+++ b/crates/biome_js_analyze/src/lint/nursery/use_trim_start_end.rs
@@ -263,9 +263,9 @@ fn suggested_name(text: &SyntaxToken<JsLanguage>) -> Option<String> {
 
     generate_suggested_name(unquoted).map(|suggested_name| {
         if is_single_quoted {
-            format!("'{}'", suggested_name)
+            format!("'{suggested_name}'")
         } else if is_double_quoted {
-            format!("\"{}\"", suggested_name)
+            format!("\"{suggested_name}\"")
         } else {
             suggested_name.to_string()
         }
diff --git a/crates/biome_js_formatter/src/utils/string_utils.rs b/crates/biome_js_formatter/src/utils/string_utils.rs
index 0e3ef1a5eaf3..4378ebf93a0c 100644
--- a/crates/biome_js_formatter/src/utils/string_utils.rs
+++ b/crates/biome_js_formatter/src/utils/string_utils.rs
@@ -360,10 +360,7 @@ impl<'token> LiteralStringNormaliser<'token> {
             Cow::Borrowed(original)
         } else {
             Cow::Owned(std::format!(
-                "{}{}{}",
-                preferred_quote,
-                content_to_use,
-                preferred_quote,
+                "{preferred_quote}{content_to_use}{preferred_quote}",
             ))
         }
     }


Test patch:
diff --git a/crates/biome_formatter_test/src/check_reformat.rs b/crates/biome_formatter_test/src/check_reformat.rs
index dc288d8ec1a6..afeea12804de 100644
--- a/crates/biome_formatter_test/src/check_reformat.rs
+++ b/crates/biome_formatter_test/src/check_reformat.rs
@@ -71,7 +71,7 @@ where
         {
             Ok(formatted) => formatted,
             Err(err) => {
-                panic!("failed to format: {}", err);
+                panic!("failed to format: {err}");
             }
         };
 
diff --git a/crates/biome_graphql_formatter/tests/quick_test.rs b/crates/biome_graphql_formatter/tests/quick_test.rs
index 9cdb0b3d0756..5de744d6c31a 100644
--- a/crates/biome_graphql_formatter/tests/quick_test.rs
+++ b/crates/biome_graphql_formatter/tests/quick_test.rs
@@ -24,7 +24,7 @@ E {
 
 "#;
     let parse = parse_graphql(src);
-    println!("{:#?}", parse);
+    println!("{parse:#?}");
 
     let options = GraphqlFormatOptions::default()
         .with_line_width(LineWidth::try_from(80).unwrap())