Skip to content

Rust nightly removed the lifetime from Pattern #1219

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

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Don't elide lifetime
  • Loading branch information
mischnic committed Aug 2, 2024
commit b587720ebe0ebb3e46bddea24b9955d07efca537
2 changes: 1 addition & 1 deletion src/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct RegexSearcher<'r, 't> {
impl<'r> Pattern for &'r Regex {
type Searcher<'t> = RegexSearcher<'r, 't>;

fn into_searcher(self, haystack: &str) -> RegexSearcher<'r, '_> {
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