-
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
FP single_component_path_imports #7168
Comments
So you want the |
It is accessible as |
Yes, obviously the suggestion is not okay as is. I'm just asking from a code style viewpoint. Because this questions the assertion that "single component imports are always useless/bad style" which seems to be the idea behind the lint. |
From a code style viewpoint I think it's a great lint, I've applied many suggestions due to this lint. In this case the |
Yep that sounds reasonable. Hopefully it isn't too gnarly to implement. Scanning usages can be problematic. But I think this might be a relatively simple case. |
We should also detect usages like |
Lint name:
single_component_path_imports
I tried this code:
(I think it doesn't matter whether the feature
log
is turned on or off.)I expected to see this happen: no warning, since the
log
import is used in an inner module.Instead, this happened:
Meta
cargo clippy -V
: clippy 0.1.53 (42816d6 2021-04-24)rustc -Vv
:cc @ThibsG (re #6905 (comment))
The text was updated successfully, but these errors were encountered: