You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When importing things, my IDE isn't very smart about how it adds new use statements. Thankfully rustfmt mostly cleans it up, but one thing it doesn't seem to do is move module imports into the same block as their children if some of their components are also imported.
A common case for me is when manually implementing Debug on something - I often end up with the following after rustfmt cleans up (with imports_granularity = "Crate"):
Thanks for reaching out, but I suspect this would run into the same non-semantics preserving behavior as described in rust-lang/rust#60941 and is not something rustfmt would be able to do.
If you're confident that can be guaranteed to always preserve semantics then please let us know and we'll reconsider!
When importing things, my IDE isn't very smart about how it adds new
use
statements. Thankfully rustfmt mostly cleans it up, but one thing it doesn't seem to do is move module imports into the same block as their children if some of their components are also imported.A common case for me is when manually implementing
Debug
on something - I often end up with the following after rustfmt cleans up (withimports_granularity = "Crate"
):It would be nice to have an option (or default behaviour, I'm not sure) to have rustfmt format the imports as:
It saves space, looks cleaner, and in a big import tree, makes it easier to read imo.
The text was updated successfully, but these errors were encountered: