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
trait_not_impl
Lints for warnings where traits are only imported for their methods, not to be implemented on a type
Suggestion: rename traits to _.
_
Remove potential name conflicts when importing multiple traits, such as io::Write and fmt::Write
io::Write
fmt::Write
Would need to be named if multiple traits have the same named methods and one needs selected
use std::fmt::{Display, Formatter, Result, Write}; struct Foo(char); impl Display for Foo { fn fmt(&self, f: &mut Formatter<'_>) -> Result { f.write_char(self.0) } }
Could be written as:
use std::fmt::{Display, Formatter, Result, Write as _}; struct Foo(char); impl Display for Foo { fn fmt(&self, f: &mut Formatter<'_>) -> Result { f.write_char(self.0) } }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
What it does
Lints for warnings where traits are only imported for their methods, not to be implemented on a type
Suggestion: rename traits to
_
.Advantage
Remove potential name conflicts when importing multiple traits, such as
io::Write
andfmt::Write
Drawbacks
Would need to be named if multiple traits have the same named methods and one needs selected
Example
Could be written as:
The text was updated successfully, but these errors were encountered: