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

Rfc: use block indent for multi-lined imports #1785

Merged
merged 6 commits into from
Jul 14, 2017

Conversation

topecongiro
Copy link
Contributor

Closes #1784.

@nrc
Copy link
Member

nrc commented Jul 12, 2017

Hmm, it turns out we didn't agree on a style for this (rust-lang/style-team#24), so I think we should not change the default for now. Could we put this behind an option for now?

@topecongiro
Copy link
Contributor Author

Looks like using multiple imports are not welcomed, so I will change this PR to support A, C and D.

@topecongiro
Copy link
Contributor Author

@nrc Do you think we could set reorder_imported_names to true as default? I think this is agreed in rust-lang/style-team#24. If so, we need to implement better sorting.

@nrc
Copy link
Member

nrc commented Jul 13, 2017

Do you think we could set reorder_imported_names to true as default?

Yes, I think that would be great (once the sorting matches the spec).

@topecongiro
Copy link
Contributor Author

Updated & rebased.

Copy link
Member

@nrc nrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This great, thank you! I had a minor clarifying question for the options docs, otherwise looks ready to land

```rust
use foo::{xxx, yyy, zzz};

use foo::{aaa, bbb, ccc, ddd, eee, fff};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when this gets too long to fit on one line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When Horizontal layout is spcecified, rustfmt forces horitonzal layout and puts every thing on one line even if it exceeds max width.

@topecongiro
Copy link
Contributor Author

Added note to Configurations.md about using Horizontal option.

@nrc nrc merged commit 05d043c into rust-lang:master Jul 14, 2017
@topecongiro topecongiro deleted the rfc/import branch July 14, 2017 04:39
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