From ed3437208042e0829dd9ff019f0cda29c56896ab Mon Sep 17 00:00:00 2001 From: Zachary Dremann Date: Fri, 23 May 2025 21:35:15 -0400 Subject: [PATCH] fix compilation of the pattern feature See: https://github.com/rust-lang/rust/pull/127481 --- src/pattern.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pattern.rs b/src/pattern.rs index c0bbb20..000a987 100644 --- a/src/pattern.rs +++ b/src/pattern.rs @@ -51,13 +51,13 @@ impl<'h> CoreSearcher<'h> { } } -impl<'h, F> Pattern<'h> for AsciiChars +impl Pattern for AsciiChars where F: Fn(u8) -> bool, { - type Searcher = AsciiCharsSearcher<'h, F>; + type Searcher<'h> = AsciiCharsSearcher<'h, F>; - fn into_searcher(self, haystack: &'h str) -> Self::Searcher { + fn into_searcher(self, haystack: &str) -> Self::Searcher<'_> { AsciiCharsSearcher { searcher: CoreSearcher::new(haystack), finder: self, @@ -105,10 +105,10 @@ where /// substring to search for is the empty string. It will never /// match. This behavior may change in the future to more closely /// align with the standard library. -impl<'n, 'h> Pattern<'h> for Substring<'n> { - type Searcher = SubstringSearcher<'n, 'h>; +impl<'n> Pattern for Substring<'n> { + type Searcher<'h> = SubstringSearcher<'n, 'h>; - fn into_searcher(self, haystack: &'h str) -> Self::Searcher { + fn into_searcher(self, haystack: &str) -> Self::Searcher<'_> { SubstringSearcher { searcher: CoreSearcher::new(haystack), finder: self,