]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/methods/get_unwrap.rs
Auto merge of #105133 - oli-obk:promoted_def_ids, r=cjgillot
[rust.git] / src / tools / clippy / clippy_lints / src / methods / get_unwrap.rs
index 18e08d6ee23206b3e905bacb685d15aa48d91f19..ffc3a4d780e5d324be025959b3a2d90dd0b6c6ab 100644 (file)
@@ -71,16 +71,11 @@ pub(super) fn check<'tcx>(
         cx,
         GET_UNWRAP,
         span,
-        &format!(
-            "called `.get{0}().unwrap()` on a {1}. Using `[]` is more clear and more concise",
-            mut_str, caller_type
-        ),
+        &format!("called `.get{mut_str}().unwrap()` on a {caller_type}. Using `[]` is more clear and more concise"),
         "try this",
         format!(
-            "{}{}[{}]",
-            borrow_str,
-            snippet_with_applicability(cx, recv.span, "..", &mut applicability),
-            get_args_str
+            "{borrow_str}{}[{get_args_str}]",
+            snippet_with_applicability(cx, recv.span, "..", &mut applicability)
         ),
         applicability,
     );