Skip to content

Commit 7e1b032

Browse files
committed
Fixed some typos.
1 parent 8b1171c commit 7e1b032

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

text/0000-os-str-pattern.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl OsStr {
8787
/// let path = OsStr::new("/usr/bin/bash");
8888
/// let range = path.find_range("/b");
8989
/// assert_eq!(range, Some(4..6));
90-
/// assert_eq!(path[range.unwrap()], OsStr::new("/bin"));
90+
/// assert_eq!(path[range.unwrap()], OsStr::new("/b"));
9191
/// ```
9292
pub fn find_range<'a, P>(&'a self, pat: P) -> Option<Range<usize>>
9393
where
@@ -101,7 +101,7 @@ impl OsStr {
101101
/// let path = OsStr::new("/usr/bin/bash");
102102
/// let range = path.rfind_range("/b");
103103
/// assert_eq!(range, Some(8..10));
104-
/// assert_eq!(path[range.unwrap()], OsStr::new("/bin"));
104+
/// assert_eq!(path[range.unwrap()], OsStr::new("/b"));
105105
/// ```
106106
pub fn rfind_range<'a, P>(&'a self, pat: P) -> Option<Range<usize>>
107107
where
@@ -445,7 +445,7 @@ match self.matcher.next_match() {
445445
let needle = OsString::from_wide(&[0xdc00]);
446446
let haystack = OsStr::new("\u{10000}a");
447447
let index = haystack.find(&needle).unwrap();
448-
let matched = &haystack[index..(index + needle.len()];
448+
let matched = &haystack[index..(index + needle.len())];
449449
// `matched` will contain "\u{dc00}a" instead of "\u{dc00}".
450450
```
451451

0 commit comments

Comments
 (0)