Skip to content
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

Use normalized form to format use items #2576

Merged
merged 6 commits into from
Apr 5, 2018

Conversation

topecongiro
Copy link
Contributor

This PR uses normalized form of ast::UseTree to format them.
My apologies for a big commit which makes this hard to review, I tried to separate them in logical way, but failed to do so...

Closes #2531.

1. snake_case < CamelCase < UPPER_SNAKE_CASE
2. Use vertical layout for list with nested imports.
This change is necessary when we remove unused imports (`use std::{};`).
This prevents the trailing `;` on use item to be treated as comment.
This commit implements `Rewrite` trait on `UseTree`, which is a normalized
form of `ast::UseTree` for rustfmt.
@nrc nrc merged commit b7ba6f7 into rust-lang:master Apr 5, 2018
@nrc
Copy link
Member

nrc commented Apr 5, 2018

Thank you!

@topecongiro topecongiro deleted the merge-imports branch April 5, 2018 06:38
@topecongiro topecongiro mentioned this pull request Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants