Skip to content

Commit

Permalink
Apply clippy::uninlined_format_args
Browse files Browse the repository at this point in the history
  • Loading branch information
oxalica committed Mar 10, 2023
1 parent 4ec9367 commit bbca41c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion crates/ide/src/def/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ baz/../../bar.nix + ../default.nix
for (src, refs) in asserts {
let got = &*db.module_references(f[src]);
let expect = refs.iter().map(|path| f[*path]).collect::<HashSet<_>>();
assert_eq!(got, &expect, "Module {:?} should reference {:?}", src, refs);
assert_eq!(got, &expect, "Module {src:?} should reference {refs:?}");
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/ide/src/ide/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub(crate) fn rename(
// `new = old;`.
edits.push(TextEdit {
delete: TextRange::empty(i.syntax().text_range().end()),
insert: format!("{} = {};", new_attr, old_attr).into(),
insert: format!("{new_attr} = {old_attr};").into(),
});
}
Some(from_expr) => {
Expand Down Expand Up @@ -142,7 +142,7 @@ pub(crate) fn rename(
// Then construct a new binding.
edits.push(TextEdit {
delete: TextRange::empty(i.syntax().text_range().end()),
insert: format!("{} = {};", old_attr, new_attr).into(),
insert: format!("{old_attr} = {new_attr};").into(),
});
}

Expand Down Expand Up @@ -227,7 +227,7 @@ mod tests {
if is_same {
src
} else {
format!("{}\n{}\n", src, text)
format!("{src}\n{text}\n")
}
}
Err(err) => err,
Expand Down
2 changes: 1 addition & 1 deletion crates/ide/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl Fixture {
.into_iter()
.take(marker_len)
.enumerate()
.map(|(i, p)| p.with_context(|| format!("Discontinuous marker: {}", i)))
.map(|(i, p)| p.with_context(|| format!("Discontinuous marker: {i}")))
.collect::<Result<Vec<_>>>()?;

Ok(this)
Expand Down
3 changes: 1 addition & 2 deletions crates/nil/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ fn main() {
match nil::main_loop(conn).and_then(|()| io_threads.join().map_err(Into::into)) {
Ok(()) => {}
Err(err) => {
tracing::error!("Unexpected error: {}", err);
eprintln!("{}", err);
tracing::error!("Unexpected error: {err:#}");
process::exit(101);
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/syntax/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl fmt::Display for ErrorKind {
Self::NestTooDeep => "Nest too deep",
Self::MultipleRoots => "Multiple top-level expressions are not allowed",
Self::MultipleNoAssoc => "No-associative operators cannot be chained",
Self::ExpectToken(tok) => return write!(f, "Expecting {}", tok),
Self::ExpectToken(tok) => return write!(f, "Expecting {tok}"),
Self::ExpectExpr => "Expecting an expression",
Self::ExpectElemExpr => "Expecting a list element expression. Forget parentheses?",
Self::ExpectAttr => {
Expand Down
2 changes: 1 addition & 1 deletion crates/syntax/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn run_test(dir: &Path, ok: bool) {
write!(got, "{:#?}", ast.syntax_node()).unwrap();

if ok != ast.errors().is_empty() {
println!("--------\n{}\n--------", got);
println!("--------\n{got}\n--------");
panic!("Unexpected test result for {}", path.display());
}

Expand Down
4 changes: 3 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@
"-D" "warnings"

"-D" "clippy::dbg_macro"
"-D" "clippy::todo"

"-D" "clippy::doc_markdown"
"-D" "clippy::manual-let-else"
"-D" "clippy::missing-panics-doc"
"-D" "clippy::semicolon_if_nothing_returned"
"-D" "clippy::todo"
"-D" "clippy::uninlined_format_args"
];

pre-commit = pkgs.writeShellScriptBin "pre-commit" ''
Expand Down

0 comments on commit bbca41c

Please sign in to comment.