-
Notifications
You must be signed in to change notification settings - Fork 911
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
merge_imports breaks apart imports #3112
Comments
Even if this is the desired behavior, documentation should be clear about it. Current docs:
Possible example that shows all the differences:
|
I think |
Perhaps a better name would be something like |
I think we need to revisit both how imports are formatted and the options available post-1.0 |
I do not know how closely rustfmt is integrated w/ the compiler. Would rustfmt be able to choose the shortest import path, so that it could convert:
to
since |
@calebcartwright I feel like the current behavior is intended and this can be closed. Maybe we need to add a new |
Correct @ytmimi so I'm going to close. There's a number of variants under imports_granularity (https://rust-lang.github.io/rustfmt/?version=v1.5.1&search=#imports_granularity) with respective textual descriptions and examples. If anyone believes those can be improved/elaborated then feel free to submit a PR, but there's no need to keep this issue open for any potential documentation enhancements. Additionally, the single-import statement flavor discussed in the OP is covered in #5360 and is better tracked there given its context in the present day configuration surface. |
merge_imports actually causes nested imports to be broken apart, not merged. This seems counterintuitive to me.
The text was updated successfully, but these errors were encountered: