-
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
fix: imports_granularity module with path containing self #5253
fix: imports_granularity module with path containing self #5253
Conversation
Moves towards stabilising |
Thanks so much! Will try to get to this shortly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! LGTM overall, with one inline question for you
src/imports.rs
Outdated
if merge_by == SharedPrefix::Module { | ||
flattened = flattened.nest_trailing_self(); | ||
} | ||
result.push(flattened.nest_trailing_self()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to make this nest call in the non-module case, and twice for the module case?
If so could you add or point to a test case that demonstrates why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, that's definitely unnecessary, good spot. I added the conditional merge_by
check later, I just forgot to remove the unconditional case.
Squashed and updated, ready for review again.
79fe168
to
a82b008
Compare
Excellent, thank you! |
Closes #4681
(unintentionally) ports #4716 from
rustfmt-2.0.0-rc.2
tomaster
, with some additional refactoring.It looks like this issue was already fixed, but was then lost in the
rustfmt-2.0.0-rc.2
branch on this commit: 0e90855I implemented this separately but came up with a satisfyingly similar implementation - I've read the review comments on the original PR, so I don't think there should be much to add, but do let me know if anything needs changing!