Skip to content

fix compilation of the pattern feature #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ impl<'h> CoreSearcher<'h> {
}
}

impl<'h, F> Pattern<'h> for AsciiChars<F>
impl<F> Pattern for AsciiChars<F>
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,
Expand Down Expand Up @@ -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,
Expand Down
Loading