Skip to content
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

Rust nightly removed the lifetime from Pattern #1219

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Changes from 2 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
6 changes: 3 additions & 3 deletions src/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ pub struct RegexSearcher<'r, 't> {
next_match: Option<(usize, usize)>,
}

impl<'r, 't> Pattern<'t> for &'r Regex {
type Searcher = RegexSearcher<'r, 't>;
impl<'r> Pattern for &'r Regex {
type Searcher<'t> = RegexSearcher<'r, 't>;

fn into_searcher(self, haystack: &'t str) -> RegexSearcher<'r, 't> {
fn into_searcher<'h>(self, haystack: &'h str) -> RegexSearcher<'r, 'h> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, can this be 't instead of 'h to be consistent? I don't think there is a shadowing concern here.

RegexSearcher {
haystack,
it: self.find_iter(haystack),
Expand Down