-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
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
A new lint for imports ending in ::{self};
#6552
Comments
I think this is a rustfmt bug. rustfmt does the following:
|
I take it back. See rust-lang/rustfmt#3568. For this lint, clippy would need to check if changing the import will break it. |
This looks interesting! I'd like to give it a try. @rustbot claim |
I'm just about done with this, but I've run into an issue. As far as I can tell, there's no way to see what items are exported from an external crate, meaning that I can't check if removing |
For |
Thank you! That works for external crates, but checking a local mod gives:
Do you know what that is? If it isn't fixable I can use |
Hmm, looks like
Seems like a good solution. |
Thanks for your help! |
What it does
It detects imports that end in
::{self};
and emits a warning for them.Categories (optional)
clippy::style
.The advantage of the recommended code over the original code is that it's shorter and simpler.
Drawbacks
None.
Example
Could be written as:
The text was updated successfully, but these errors were encountered: