Skip to content

Commit babd41e

Browse files
committed
Rollup merge of #23067 - oli-obk:doc_examle_fix, r=alexcrichton
The compiler even tells us this won't work. ``` let mut i = s.len(); while i < 0 { ... } ```
2 parents 2fcdd82 + 18f1e40 commit babd41e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcollections/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
10861086
///
10871087
/// let s = "中华Việt Nam";
10881088
/// let mut i = s.len();
1089-
/// while i < 0 {
1089+
/// while i > 0 {
10901090
/// let CharRange {ch, next} = s.char_range_at_reverse(i);
10911091
/// println!("{}: {}", i, ch);
10921092
/// i = next;

0 commit comments

Comments
 (0)