We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to_string
format!("{}")
Sometime, people are using format!("{}") to stringify an object, which can be rewritten in .to_string() to keep code clean.
.to_string()
No response
style
let a = format!("{}", x);
Could be written as:
let a = x.to_string();
The text was updated successfully, but these errors were encountered:
Could it be this already exists? https://rust-lang.github.io/rust-clippy/master/#useless_format
Sorry, something went wrong.
useless_format only take effect if foo is a string, but it should be any type that implemented Display.
useless_format
foo
Display
LOL #697
No branches or pull requests
What it does
Sometime, people are using
format!("{}")
to stringify an object, which can be rewritten in.to_string()
to keep code clean.Lint Name
No response
Category
style
Advantage
No response
Drawbacks
No response
Example
Could be written as:
The text was updated successfully, but these errors were encountered: