Skip to content

Commit 8ff13f4

Browse files
authored
Rollup merge of #76309 - lzutao:indent-note, r=jyn514
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 ?
2 parents 52d9162 + dfd219d commit 8ff13f4

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

library/core/src/slice/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -3357,8 +3357,9 @@ mod private_slice_index {
33573357
on(T = "str", label = "string indices are ranges of `usize`",),
33583358
on(
33593359
all(any(T = "str", T = "&str", T = "std::string::String"), _Self = "{integer}"),
3360-
note = "you can use `.chars().nth()` or `.bytes().nth()`
3361-
see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>"
3360+
note = "you can use `.chars().nth()` or `.bytes().nth()`\n\
3361+
for more information, see chapter 8 in The Book: \
3362+
<https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>"
33623363
),
33633364
message = "the type `{T}` cannot be indexed by `{Self}`",
33643365
label = "slice indices are of type `usize` or ranges of `usize`"

src/test/ui/str/str-idx.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let _: u8 = s[4];
66
|
77
= help: the trait `SliceIndex<str>` is not implemented for `{integer}`
88
= note: you can use `.chars().nth()` or `.bytes().nth()`
9-
see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
9+
for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
1010
= note: required because of the requirements on the impl of `Index<{integer}>` for `str`
1111

1212
error[E0277]: the type `str` cannot be indexed by `{integer}`
@@ -17,7 +17,7 @@ LL | let _ = s.get(4);
1717
|
1818
= help: the trait `SliceIndex<str>` is not implemented for `{integer}`
1919
= note: you can use `.chars().nth()` or `.bytes().nth()`
20-
see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
20+
for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
2121

2222
error[E0277]: the type `str` cannot be indexed by `{integer}`
2323
--> $DIR/str-idx.rs:5:29
@@ -27,7 +27,7 @@ LL | let _ = s.get_unchecked(4);
2727
|
2828
= help: the trait `SliceIndex<str>` is not implemented for `{integer}`
2929
= note: you can use `.chars().nth()` or `.bytes().nth()`
30-
see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
30+
for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
3131

3232
error[E0277]: the type `str` cannot be indexed by `char`
3333
--> $DIR/str-idx.rs:6:17

src/test/ui/str/str-mut-idx.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ LL | s.get_mut(1);
3939
|
4040
= help: the trait `SliceIndex<str>` is not implemented for `{integer}`
4141
= note: you can use `.chars().nth()` or `.bytes().nth()`
42-
see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
42+
for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
4343

4444
error[E0277]: the type `str` cannot be indexed by `{integer}`
4545
--> $DIR/str-mut-idx.rs:11:25
@@ -49,7 +49,7 @@ LL | s.get_unchecked_mut(1);
4949
|
5050
= help: the trait `SliceIndex<str>` is not implemented for `{integer}`
5151
= note: you can use `.chars().nth()` or `.bytes().nth()`
52-
see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
52+
for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
5353

5454
error[E0277]: the type `str` cannot be indexed by `char`
5555
--> $DIR/str-mut-idx.rs:13:5

0 commit comments

Comments
 (0)