Skip to content

Commit dc4acf6

Browse files
committed
Fix adjacent code
1 parent 3486fe5 commit dc4acf6

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
@@ -129,7 +129,7 @@ fn generate_lint_files(
129129
for (lint_group, lints) in Lint::by_lint_group(usable_lints.into_iter().chain(internal_lints)) {
130130
let content = gen_lint_group_list(&lint_group, lints.iter());
131131
process_file(
132-
&format!("clippy_lints/src/lib.register_{lint_group}.rs"),
132+
format!("clippy_lints/src/lib.register_{lint_group}.rs"),
133133
update_mode,
134134
&content,
135135
);

clippy_lints/src/lib.rs

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

417417
let msrv = conf.msrv.as_ref().and_then(|s| {
418418
parse_msrv(s, None, None).or_else(|| {
419-
sess.err(&format!(
419+
sess.err(format!(
420420
"error reading Clippy's configuration file. `{s}` is not a valid Rust version"
421421
));
422422
None
@@ -432,7 +432,7 @@ fn read_msrv(conf: &Conf, sess: &Session) -> Option<RustcVersion> {
432432
.and_then(|v| parse_msrv(&v, None, None));
433433
let clippy_msrv = conf.msrv.as_ref().and_then(|s| {
434434
parse_msrv(s, None, None).or_else(|| {
435-
sess.err(&format!(
435+
sess.err(format!(
436436
"error reading Clippy's configuration file. `{s}` is not a valid Rust version"
437437
));
438438
None
@@ -443,7 +443,7 @@ fn read_msrv(conf: &Conf, sess: &Session) -> Option<RustcVersion> {
443443
if let Some(clippy_msrv) = clippy_msrv {
444444
// if both files have an msrv, let's compare them and emit a warning if they differ
445445
if clippy_msrv != cargo_msrv {
446-
sess.warn(&format!(
446+
sess.warn(format!(
447447
"the MSRV in `clippy.toml` and `Cargo.toml` differ; using `{clippy_msrv}` from `clippy.toml`"
448448
));
449449
}
@@ -472,7 +472,7 @@ pub fn read_conf(sess: &Session) -> Conf {
472472
let TryConf { conf, errors, warnings } = utils::conf::read(&file_name);
473473
// all conf errors are non-fatal, we just use the default conf in case of error
474474
for error in errors {
475-
sess.err(&format!(
475+
sess.err(format!(
476476
"error reading Clippy's configuration file `{}`: {}",
477477
file_name.display(),
478478
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
@@ -123,7 +123,7 @@ pub fn parse_msrv(msrv: &str, sess: Option<&Session>, span: Option<Span>) -> Opt
123123
return Some(version);
124124
} else if let Some(sess) = sess {
125125
if let Some(span) = span {
126-
sess.span_err(span, &format!("`{msrv}` is not a valid Rust version"));
126+
sess.span_err(span, format!("`{msrv}` is not a valid Rust version"));
127127
}
128128
}
129129
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)