Auto merge of #111922 - vaporoxx:feat-searcher, r=dtolnay
feat: implement `DoubleEndedSearcher` for `CharArray[Ref]Searcher` This PR implements `DoubleEndedSearcher` for both `CharArraySearcher` and `CharArrayRefSearcher`. I'm not sure whether this was just overlooked or if there is a reason for it, but since it behaves exactly like `CharSliceSearcher`, I think the implementations should be appropriate.
This commit is contained in:
commit
f6dcaee23f
@ -806,6 +806,8 @@ unsafe impl<'a, const N: usize> ReverseSearcher<'a> for CharArraySearcher<'a, N>
|
|||||||
searcher_methods!(reverse);
|
searcher_methods!(reverse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, const N: usize> DoubleEndedSearcher<'a> for CharArraySearcher<'a, N> {}
|
||||||
|
|
||||||
/// Searches for chars that are equal to any of the [`char`]s in the array.
|
/// Searches for chars that are equal to any of the [`char`]s in the array.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@ -826,6 +828,8 @@ unsafe impl<'a, 'b, const N: usize> ReverseSearcher<'a> for CharArrayRefSearcher
|
|||||||
searcher_methods!(reverse);
|
searcher_methods!(reverse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, 'b, const N: usize> DoubleEndedSearcher<'a> for CharArrayRefSearcher<'a, 'b, N> {}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Impl for &[char]
|
// Impl for &[char]
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user