Skip to content

Commit 52318c0

Browse files
committed
Fix adjacent code
1 parent 409761f commit 52318c0

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

clippy_dev/src/update_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn generate_lint_files(
128128
for (lint_group, lints) in Lint::by_lint_group(usable_lints.into_iter().chain(internal_lints)) {
129129
let content = gen_lint_group_list(&lint_group, lints.iter());
130130
process_file(
131-
&format!("clippy_lints/src/lib.register_{lint_group}.rs"),
131+
format!("clippy_lints/src/lib.register_{lint_group}.rs"),
132132
update_mode,
133133
&content,
134134
);

clippy_lints/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore, sess: &Se
417417

418418
let msrv = conf.msrv.as_ref().and_then(|s| {
419419
parse_msrv(s, None, None).or_else(|| {
420-
sess.err(&format!(
420+
sess.err(format!(
421421
"error reading Clippy's configuration file. `{s}` is not a valid Rust version"
422422
));
423423
None
@@ -433,7 +433,7 @@ fn read_msrv(conf: &Conf, sess: &Session) -> Option<RustcVersion> {
433433
.and_then(|v| parse_msrv(&v, None, None));
434434
let clippy_msrv = conf.msrv.as_ref().and_then(|s| {
435435
parse_msrv(s, None, None).or_else(|| {
436-
sess.err(&format!(
436+
sess.err(format!(
437437
"error reading Clippy's configuration file. `{s}` is not a valid Rust version"
438438
));
439439
None
@@ -444,7 +444,7 @@ fn read_msrv(conf: &Conf, sess: &Session) -> Option<RustcVersion> {
444444
if let Some(clippy_msrv) = clippy_msrv {
445445
// if both files have an msrv, let's compare them and emit a warning if they differ
446446
if clippy_msrv != cargo_msrv {
447-
sess.warn(&format!(
447+
sess.warn(format!(
448448
"the MSRV in `clippy.toml` and `Cargo.toml` differ; using `{clippy_msrv}` from `clippy.toml`"
449449
));
450450
}
@@ -473,7 +473,7 @@ pub fn read_conf(sess: &Session) -> Conf {
473473
let TryConf { conf, errors, warnings } = utils::conf::read(&file_name);
474474
// all conf errors are non-fatal, we just use the default conf in case of error
475475
for error in errors {
476-
sess.err(&format!(
476+
sess.err(format!(
477477
"error reading Clippy's configuration file `{}`: {}",
478478
file_name.display(),
479479
format_error(error)

clippy_lints/src/nonstandard_macro_braces.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ impl<'de> Deserialize<'de> for MacroMatcher {
266266
.iter()
267267
.find(|b| b.0 == brace)
268268
.map(|(o, c)| ((*o).to_owned(), (*c).to_owned()))
269-
.ok_or_else(|| de::Error::custom(&format!("expected one of `(`, `{{`, `[` found `{brace}`")))?,
269+
.ok_or_else(|| de::Error::custom(format!("expected one of `(`, `{{`, `[` found `{brace}`")))?,
270270
})
271271
}
272272
}

clippy_utils/src/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub fn get_unique_inner_attr(sess: &Session, attrs: &[ast::Attribute], name: &'s
136136
.emit();
137137
},
138138
ast::AttrStyle::Outer => {
139-
sess.span_err(attr.span, &format!("`{name}` cannot be an outer attribute"));
139+
sess.span_err(attr.span, format!("`{name}` cannot be an outer attribute"));
140140
},
141141
}
142142
}

clippy_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub fn parse_msrv(msrv: &str, sess: Option<&Session>, span: Option<Span>) -> Opt
125125
return Some(version);
126126
} else if let Some(sess) = sess {
127127
if let Some(span) = span {
128-
sess.span_err(span, &format!("`{msrv}` is not a valid Rust version"));
128+
sess.span_err(span, format!("`{msrv}` is not a valid Rust version"));
129129
}
130130
}
131131
None

tests/compile-test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ fn run_ui_cargo() {
283283
env::set_current_dir(&src_path)?;
284284

285285
let cargo_toml_path = case.path().join("Cargo.toml");
286-
let cargo_content = fs::read(&cargo_toml_path)?;
286+
let cargo_content = fs::read(cargo_toml_path)?;
287287
let cargo_parsed: toml::Value = toml::from_str(
288288
std::str::from_utf8(&cargo_content).expect("`Cargo.toml` is not a valid utf-8 file!"),
289289
)

0 commit comments

Comments
 (0)