Skip to content

Commit dfd219d

Browse files
tesujiJoshua Nelson
and
Joshua Nelson
committed
Indent a note to make folding work nicer
Co-authored-by: Joshua Nelson <[email protected]>
1 parent 70c5f6e commit dfd219d

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
@@ -3358,8 +3358,9 @@ mod private_slice_index {
33583358
on(T = "str", label = "string indices are ranges of `usize`",),
33593359
on(
33603360
all(any(T = "str", T = "&str", T = "std::string::String"), _Self = "{integer}"),
3361-
note = "you can use `.chars().nth()` or `.bytes().nth()`
3362-
see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>"
3361+
note = "you can use `.chars().nth()` or `.bytes().nth()`\n\
3362+
for more information, see chapter 8 in The Book: \
3363+
<https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>"
33633364
),
33643365
message = "the type `{T}` cannot be indexed by `{Self}`",
33653366
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)