]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/methods/expect_fun_call.rs
Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyup
[rust.git] / src / tools / clippy / clippy_lints / src / methods / expect_fun_call.rs
index bd846d71d4668ed29288ea248849193432903462..d0cf411dfd34caca494b9675d518fe742a1c4653 100644 (file)
@@ -143,9 +143,9 @@ fn is_call(node: &hir::ExprKind<'_>) -> bool {
             cx,
             EXPECT_FUN_CALL,
             span_replace_word,
-            &format!("use of `{}` followed by a function call", name),
+            &format!("use of `{name}` followed by a function call"),
             "try this",
-            format!("unwrap_or_else({} panic!({}))", closure_args, sugg),
+            format!("unwrap_or_else({closure_args} panic!({sugg}))"),
             applicability,
         );
         return;
@@ -160,12 +160,9 @@ fn is_call(node: &hir::ExprKind<'_>) -> bool {
         cx,
         EXPECT_FUN_CALL,
         span_replace_word,
-        &format!("use of `{}` followed by a function call", name),
+        &format!("use of `{name}` followed by a function call"),
         "try this",
-        format!(
-            "unwrap_or_else({} {{ panic!(\"{{}}\", {}) }})",
-            closure_args, arg_root_snippet
-        ),
+        format!("unwrap_or_else({closure_args} {{ panic!(\"{{}}\", {arg_root_snippet}) }})"),
         applicability,
     );
 }