Skip to content

Commit b67adbe

Browse files
committed
TRPL: minor correction on how chars().nth() work
The previous wording was confusing. While would we need to go through the whole list just to find the first code point? `chars()` being an iterator, we only need to walk from the beginning of the list.
1 parent cbf4c34 commit b67adbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/doc/trpl/strings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ You can get something similar to an index like this:
115115
let dog = hachiko.chars().nth(1); // kinda like hachiko[1]
116116
```
117117

118-
This emphasizes that we have to go through the whole list of `chars`.
118+
This emphasizes that we have to walk from the beginning of the list of `chars`.
119119

120120
## Slicing
121121

0 commit comments

Comments
 (0)