-
Notifications
You must be signed in to change notification settings - Fork 898
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
Deduplication doesn't occur with `imports_granularity = "Item" #4725
Comments
Thanks for opening this! We'd actually just observed this recently as well (#4716 (comment)) so good to have an issue to track 👍 |
For anyone interested in working on this, would suggest starting here given the current code structure. Note that the trees are not yet sorted at this point, as sorting conditionally happens a bit later on depending on the user specified value for the rustfmt/src/formatting/imports.rs Lines 185 to 201 in 74768b7
|
@calebcartwright |
Sure! However, I think @davidBar-On may have beaten you to it in #4737. Will leave it to the two of you to sort who wants to work on it. |
@zaki-yama, I suggest to see if my approach in PR #4737 to resolve the issue is accepted. If not, I have no problem that you will take over. (Usually I am not trying to resolve new |
@calebcartwright @davidBar-On |
Resolved via 6b415bd, backport/release pending |
Describe the bug
Duplicate imports are not removed with
imports_granularity = "Item"
turned on.To Reproduce
test.rs
.rustfmt.toml
Run
rustfmt test.rs
Expected behavior
Duplicate
use std::env;
should be removed. It is not.Meta
rustfmt 1.4.36-nightly (7de6968 2021-02-07)
asdf install
with .tool-versionsrust nightly-2021-02-17
rustfmt
, in VSCodeThe text was updated successfully, but these errors were encountered: