Skip to content

Commit fbc6050

Browse files
committed
Fix adjacent code
1 parent 54451bd commit fbc6050

21 files changed

+41
-41
lines changed

clippy_dev/src/bless.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn update_reference_file(test_output_entry: &DirEntry, ignore_timestamp: bool) {
4343
if test_output_file != reference_file {
4444
// If a test run caused an output file to change, update the reference file
4545
println!("updating {}", reference_file_path.display());
46-
fs::copy(test_output_path, &reference_file_path).expect("Could not update reference file");
46+
fs::copy(test_output_path, reference_file_path).expect("Could not update reference file");
4747
}
4848
}
4949

clippy_dev/src/fmt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ fn exec(
169169
if !context.check && !success {
170170
let stderr = std::str::from_utf8(&output.stderr).unwrap_or("");
171171
return Err(CliError::CommandFailed(
172-
format_command(&program, &dir, args),
172+
format_command(program, dir, args),
173173
String::from(stderr),
174174
));
175175
}
@@ -207,7 +207,7 @@ fn rustfmt_test(context: &FmtContext) -> Result<(), CliError> {
207207
Err(CliError::RustfmtNotInstalled)
208208
} else {
209209
Err(CliError::CommandFailed(
210-
format_command(program, &dir, args),
210+
format_command(program, dir, args),
211211
std::str::from_utf8(&output.stderr).unwrap_or("").to_string(),
212212
))
213213
}

clippy_dev/src/new_lint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn create_test(lint: &LintData<'_>) -> io::Result<()> {
9898
fs::create_dir(&test_dir)?;
9999

100100
create_project_layout(lint.name, &test_dir, "fail", "Content that triggers the lint goes here")?;
101-
create_project_layout(lint.name, &test_dir, "pass", "This file should not trigger the lint")?;
101+
create_project_layout(lint.name, test_dir, "pass", "This file should not trigger the lint")?;
102102

103103
println!("Generated test directories: `{relative_test_dir}/pass`, `{relative_test_dir}/fail`");
104104
} else {

clippy_dev/src/serve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn mtime(path: impl AsRef<Path>) -> SystemTime {
4949
.into_iter()
5050
.flatten()
5151
.flatten()
52-
.map(|entry| mtime(&entry.path()))
52+
.map(|entry| mtime(entry.path()))
5353
.max()
5454
.unwrap_or(SystemTime::UNIX_EPOCH)
5555
} else {

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: Optio
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/large_enum_variant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl<'tcx> LateLintPass<'tcx> for LargeEnumVariant {
152152
);
153153
diag.span_label(
154154
def.variants[variants_size[1].ind].span,
155-
&if variants_size[1].fields_size.is_empty() {
155+
if variants_size[1].fields_size.is_empty() {
156156
"the second-largest variant carries no data at all".to_owned()
157157
} else {
158158
format!(

clippy_lints/src/len_zero.rs

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

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
}

clippy_lints/src/methods/str_splitn.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fn check_manual_split_once_indirect(
167167
};
168168
diag.span_suggestion_verbose(
169169
local.span,
170-
&format!("try `{r}split_once`"),
170+
format!("try `{r}split_once`"),
171171
format!("let ({lhs}, {rhs}) = {self_snip}.{r}split_once({pat_snip}){unwrap};"),
172172
app,
173173
);
@@ -181,7 +181,7 @@ fn check_manual_split_once_indirect(
181181
);
182182
diag.span_suggestion(
183183
second.span,
184-
&remove_msg,
184+
remove_msg,
185185
"",
186186
app,
187187
);

clippy_lints/src/module_style.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ impl EarlyLintPass for ModStyle {
119119
Span::new(file.start_pos, file.start_pos, SyntaxContext::root(), None),
120120
|build| {
121121
let mut lint =
122-
build.build(&format!("`mod.rs` files are required, found `{}`", path.display()));
123-
lint.help(&format!("move `{}` to `{}`", path.display(), correct.display(),));
122+
build.build(format!("`mod.rs` files are required, found `{}`", path.display()));
123+
lint.help(format!("move `{}` to `{}`", path.display(), correct.display(),));
124124
lint.emit();
125125
},
126126
);
@@ -157,8 +157,8 @@ fn check_self_named_mod_exists(cx: &EarlyContext<'_>, path: &Path, file: &Source
157157
MOD_MODULE_FILES,
158158
Span::new(file.start_pos, file.start_pos, SyntaxContext::root(), None),
159159
|build| {
160-
let mut lint = build.build(&format!("`mod.rs` files are not allowed, found `{}`", path.display()));
161-
lint.help(&format!("move `{}` to `{}`", path.display(), mod_file.display(),));
160+
let mut lint = build.build(format!("`mod.rs` files are not allowed, found `{}`", path.display()));
161+
lint.help(format!("move `{}` to `{}`", path.display(), mod_file.display(),));
162162
lint.emit();
163163
},
164164
);

0 commit comments

Comments
 (0)