-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Indent a note to make folding work nicer #76309
Conversation
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.
r=me with nit fixed
You also need to run |
ae5b7cc
to
7347aa9
Compare
library/core/src/slice/mod.rs
Outdated
note = "you can use `.chars().nth()` or `.bytes().nth()` | ||
see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>" | ||
note = "you can use `.chars().nth()` or `.bytes().nth()`\n\ | ||
For more information, see chapter 8 in The Book: \ |
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.
Nit: this is changing it to visual indent (following the position of the "
"), but it should be block-indented instead, per https://github.com/rust-dev-tools/fmt-rfcs/blob/master/guide/principles.md#overarching-guidelines
So something like
on(
all(any(T = "str", T = "&str", T = "std::string::String"), _Self = "{integer}"),
note = "you can use `.chars().nth()` or `.bytes().nth()`\n\
For more information, see chapter 8 in The Book: \
(Note how the all
is indented 4, not 3 as it would be if it were following on(
)
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 case is more like:
// Block indent
a_function_call(foo,
bar,
);
LGTM, r? @scottmcm #76309 (comment) |
Looks like there are some more test failures in PR here, @lzutao? |
Needs you to run
|
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
Thanks, blessed the tests. |
📌 Commit dfd219d has been approved by |
@jyn514 All good -- I looked at the other places that attribute is used and there's at least two different indentation styles in use already 🤷♀️ |
Indent a note to make folding work nicer Sublime Text folds code based on indentation. It maybe an unnecessary change, but does it look nicer after that ?
Rollup of 18 pull requests Successful merges: - rust-lang#76273 (Move some Vec UI tests into alloc unit tests) - rust-lang#76274 (Allow try blocks as the argument to return expressions) - rust-lang#76287 (Remove an unnecessary allowed lint) - rust-lang#76293 (Implementation of incompatible features error) - rust-lang#76299 (Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`) - rust-lang#76302 (Address review comments on `Peekable::next_if`) - rust-lang#76303 (Link to `#capacity-and-reallocation` when using with_capacity) - rust-lang#76305 (Move various ui const tests to `library`) - rust-lang#76309 (Indent a note to make folding work nicer) - rust-lang#76312 (time.rs: Make spelling of "Darwin" consistent) - rust-lang#76318 (Use ops::ControlFlow in rustc_data_structures::graph::iterate) - rust-lang#76324 (Move Vec slice UI tests in library) - rust-lang#76338 (add some intra-doc links to `Iterator`) - rust-lang#76340 (Remove unused duplicated `trivial_dropck_outlives`) - rust-lang#76344 (Improve docs for `std::env::args()`) - rust-lang#76346 (Docs: nlink example typo) - rust-lang#76358 (Minor grammar fix in doc comment for soft-deprecated methods) - rust-lang#76364 (Disable atomics on avr target.) Failed merges: - rust-lang#76304 (Make delegation methods of `std::net::IpAddr` unstably const) r? @ghost
Sublime Text folds code based on indentation. It maybe an unnecessary change, but does it look nicer after that ?