diff options
| author | bors <bors@rust-lang.org> | 2023-11-17 18:47:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-17 18:47:34 +0000 |
| commit | f6dcaee23f274dd18b391b2f0f70df6e98f1c3b2 (patch) | |
| tree | 44e91f41309cdc8bba604fb09827e7588c170c69 | |
| parent | e886137e18e7bd312b1bd5e3ee9364734673b23c (diff) | |
| parent | c6ed532bef02e752ea881ab104cacc28e5d06738 (diff) | |
| download | rust-f6dcaee23f274dd18b391b2f0f70df6e98f1c3b2.tar.gz rust-f6dcaee23f274dd18b391b2f0f70df6e98f1c3b2.zip | |
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.
| -rw-r--r-- | library/core/src/str/pattern.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/core/src/str/pattern.rs b/library/core/src/str/pattern.rs index d5d6d60acf6..701e61e6615 100644 --- a/library/core/src/str/pattern.rs +++ b/library/core/src/str/pattern.rs @@ -806,6 +806,8 @@ unsafe impl<'a, const N: usize> ReverseSearcher<'a> for CharArraySearcher<'a, N> 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. /// /// # Examples @@ -826,6 +828,8 @@ unsafe impl<'a, 'b, const N: usize> ReverseSearcher<'a> for CharArrayRefSearcher searcher_methods!(reverse); } +impl<'a, 'b, const N: usize> DoubleEndedSearcher<'a> for CharArrayRefSearcher<'a, 'b, N> {} + ///////////////////////////////////////////////////////////////////////////// // Impl for &[char] ///////////////////////////////////////////////////////////////////////////// |
