@@ -87,7 +87,7 @@ impl OsStr {
87
87
/// let path = OsStr::new("/usr/bin/bash");
88
88
/// let range = path.find_range("/b");
89
89
/// assert_eq!(range, Some(4..6));
90
- /// assert_eq!(path[range.unwrap()], OsStr::new("/bin "));
90
+ /// assert_eq!(path[range.unwrap()], OsStr::new("/b "));
91
91
/// ```
92
92
pub fn find_range <'a , P >(& 'a self , pat : P ) -> Option <Range <usize >>
93
93
where
@@ -101,7 +101,7 @@ impl OsStr {
101
101
/// let path = OsStr::new("/usr/bin/bash");
102
102
/// let range = path.rfind_range("/b");
103
103
/// assert_eq!(range, Some(8..10));
104
- /// assert_eq!(path[range.unwrap()], OsStr::new("/bin "));
104
+ /// assert_eq!(path[range.unwrap()], OsStr::new("/b "));
105
105
/// ```
106
106
pub fn rfind_range <'a , P >(& 'a self , pat : P ) -> Option <Range <usize >>
107
107
where
@@ -445,7 +445,7 @@ match self.matcher.next_match() {
445
445
let needle = OsString :: from_wide (& [0xdc00 ]);
446
446
let haystack = OsStr :: new (" \ u{ 10000} a" );
447
447
let index = haystack . find (& needle ). unwrap ();
448
- let matched = & haystack [index .. (index + needle . len ()];
448
+ let matched = & haystack [index .. (index + needle . len ()) ];
449
449
// `matched` will contain "\u{dc00}a" instead of "\u{dc00}".
450
450
```
451
451
0 commit comments