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
Conversation
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 |
There was a problem hiding this comment.
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}};
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Closes #24