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 { ... } ```
This commit is contained in:
commit
babd41e5e7
@ -1086,7 +1086,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
|
||||
///
|
||||
/// let s = "中华Việt Nam";
|
||||
/// let mut i = s.len();
|
||||
/// while i < 0 {
|
||||
/// while i > 0 {
|
||||
/// let CharRange {ch, next} = s.char_range_at_reverse(i);
|
||||
/// println!("{}: {}", i, ch);
|
||||
/// i = next;
|
||||
|
Loading…
Reference in New Issue
Block a user