Skip to content

Commit 26df551

Browse files
committed
Fix adjacent code
1 parent ed519ad commit 26df551

27 files changed

+43
-43
lines changed

clippy_lints/src/casts/cast_slice_different_sizes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>, msrv: &Msrv
5454

5555
diag.span_suggestion(
5656
expr.span,
57-
&format!("replace with `ptr::slice_from_raw_parts{mutbl_fn_str}`"),
57+
format!("replace with `ptr::slice_from_raw_parts{mutbl_fn_str}`"),
5858
sugg,
5959
rustc_errors::Applicability::HasPlaceholders,
6060
);

clippy_lints/src/format_args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ fn check_format_in_format_args(cx: &LateContext<'_>, call_site: Span, name: Symb
377377
call_site,
378378
&format!("`format!` in `{name}!` args"),
379379
|diag| {
380-
diag.help(&format!(
380+
diag.help(format!(
381381
"combine the `format!(..)` arguments with the outer `{name}!(..)` call"
382382
));
383383
diag.help("or consider changing `format!` to `format_args!`");

clippy_lints/src/large_enum_variant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<'tcx> LateLintPass<'tcx> for LargeEnumVariant {
111111
);
112112
diag.span_label(
113113
def.variants[variants_size[1].ind].span,
114-
&if variants_size[1].fields_size.is_empty() {
114+
if variants_size[1].fields_size.is_empty() {
115115
"the second-largest variant carries no data at all".to_owned()
116116
} else {
117117
format!(

clippy_lints/src/len_zero.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ fn check_for_is_empty<'tcx>(
361361
db.span_note(span, "`is_empty` defined here");
362362
}
363363
if let Some(self_kind) = self_kind {
364-
db.note(&output.expected_sig(self_kind));
364+
db.note(output.expected_sig(self_kind));
365365
}
366366
});
367367
}

clippy_lints/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ pub fn read_conf(sess: &Session, path: &io::Result<Option<PathBuf>>) -> Conf {
335335
Ok(Some(path)) => path,
336336
Ok(None) => return Conf::default(),
337337
Err(error) => {
338-
sess.struct_err(&format!("error finding Clippy's configuration file: {error}"))
338+
sess.struct_err(format!("error finding Clippy's configuration file: {error}"))
339339
.emit();
340340
return Conf::default();
341341
},

clippy_lints/src/loops/explicit_counter_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub(super) fn check<'tcx>(
7777
applicability,
7878
);
7979

80-
diag.note(&format!(
80+
diag.note(format!(
8181
"`{name}` is of type `{int_name}`, making it ineligible for `Iterator::enumerate`"
8282
));
8383
},

clippy_lints/src/manual_async_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<'tcx> LateLintPass<'tcx> for ManualAsyncFn {
7676
let help = format!("make the function `async` and {ret_sugg}");
7777
diag.span_suggestion(
7878
header_span,
79-
&help,
79+
help,
8080
format!("async {}{ret_snip}", &header_snip[..ret_pos]),
8181
Applicability::MachineApplicable
8282
);

clippy_lints/src/manual_strip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl<'tcx> LateLintPass<'tcx> for ManualStrip {
109109

110110
let test_span = expr.span.until(then.span);
111111
span_lint_and_then(cx, MANUAL_STRIP, strippings[0], &format!("stripping a {kind_word} manually"), |diag| {
112-
diag.span_note(test_span, &format!("the {kind_word} was tested here"));
112+
diag.span_note(test_span, format!("the {kind_word} was tested here"));
113113
multispan_sugg(
114114
diag,
115115
&format!("try using the `strip_{kind_word}` method"),

clippy_lints/src/methods/inefficient_to_string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn check(
3636
expr.span,
3737
&format!("calling `to_string` on `{arg_ty}`"),
3838
|diag| {
39-
diag.help(&format!(
39+
diag.help(format!(
4040
"`{self_ty}` implements `ToString` through a slower blanket impl, but `{deref_self_ty}` has a fast specialization of `ToString`"
4141
));
4242
let mut applicability = Applicability::MachineApplicable;

clippy_lints/src/methods/iter_skip_next.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &hir::Expr<'_>, recv: &hir::Expr
2929
application = Applicability::Unspecified;
3030
diag.span_help(
3131
pat.span,
32-
&format!("for this change `{}` has to be mutable", snippet(cx, pat.span, "..")),
32+
format!("for this change `{}` has to be mutable", snippet(cx, pat.span, "..")),
3333
);
3434
}
3535
}

0 commit comments

Comments
 (0)