Improve example of impl Pattern for &[char]
The previous version used `['l', 'l']` as pattern, which would suggest that it matches the `ll` of `Hello world` as a whole.
This commit is contained in:
parent
432972cae6
commit
4872b6bcbd
@ -886,8 +886,8 @@ impl<'a, 'b> DoubleEndedSearcher<'a> for CharSliceSearcher<'a, 'b> {}
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// assert_eq!("Hello world".find(&['l', 'l'] as &[_]), Some(2));
|
||||
/// assert_eq!("Hello world".find(&['l', 'l'][..]), Some(2));
|
||||
/// assert_eq!("Hello world".find(&['o', 'l'][..]), Some(2));
|
||||
/// assert_eq!("Hello world".find(&['h', 'w'][..]), Some(6));
|
||||
/// ```
|
||||
impl<'b> Pattern for &'b [char] {
|
||||
pattern_methods!('a, CharSliceSearcher<'a, 'b>, MultiCharEqPattern, CharSliceSearcher);
|
||||
|
Loading…
Reference in New Issue
Block a user