]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/ptr_offset_with_cast.rs
:arrow_up: rust-analyzer
[rust.git] / src / tools / clippy / clippy_lints / src / ptr_offset_with_cast.rs
index 4dc65da3ea1fd9fd8227823a0ce416c6c573a466..b0a5d1a6758285d268071ffbc1e2a586dfa2da45 100644 (file)
@@ -60,7 +60,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
             None => return,
         };
 
-        let msg = format!("use of `{}` with a `usize` casted to an `isize`", method);
+        let msg = format!("use of `{method}` with a `usize` casted to an `isize`");
         if let Some(sugg) = build_suggestion(cx, method, receiver_expr, cast_lhs_expr) {
             span_lint_and_sugg(
                 cx,
@@ -124,7 +124,7 @@ fn build_suggestion<'tcx>(
 ) -> Option<String> {
     let receiver = snippet_opt(cx, receiver_expr.span)?;
     let cast_lhs = snippet_opt(cx, cast_lhs_expr.span)?;
-    Some(format!("{}.{}({})", receiver, method.suggestion(), cast_lhs))
+    Some(format!("{receiver}.{}({cast_lhs})", method.suggestion()))
 }
 
 #[derive(Copy, Clone)]