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

Imports #129

Merged
merged 1 commit into from May 10, 2018
Merged

Imports #129

merged 1 commit into from May 10, 2018

Conversation

nrc
Copy link
Member

@nrc nrc commented May 2, 2018

Closes #24

Closes #24
@nrc nrc merged commit 0593f9a into master May 10, 2018
Prefer to use multiple imports rather than a multi-line import. However, tools
should not split imports by default (they may offer this as an option).

If an import does require multiple lines, then break after the opening brace
Copy link
Member

Choose a reason for hiding this comment

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

What determines "does require multiple lines"? in my proposal on #24, I suggested that nested imports should be broken out into their own line if they contain multiple path segments, e.g.:

// Do this
use foo::{
   bar, bal,
   baz::buz,
   bla::{blue, red},
};

// Not this
use foo::{bar, bal, baz::buz, bla::{blue, red}};

Copy link
Member

Choose a reason for hiding this comment

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

Reasonable point, and I agree.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this was my intention; I'll clarify.


#### Large list imports

Prefer to use multiple imports rather than a multi-line import. However, tools
Copy link
Member

Choose a reason for hiding this comment

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

What does prefer mean here, if tools aren't supposed to enforce it? I thought the focus of these RFCs was to determine how Rust formatting tools behaved.

Copy link
Member Author

Choose a reason for hiding this comment

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

That is the focus, but we have also given advice in some cases for humans to follow where tools can't reformat

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good! Thanks for the explanation.

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.

None yet

3 participants