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

Fix lifetimes for subcapture iterators in str regexes #214

Closed
wants to merge 1 commit into from

Conversation

birkenfeld
Copy link

So that strings extracted from a Captures::iter_named can be used
after the captures struct is dropped.

Note: I started with the re_unicode API, introducing new lifetimes. Then I discovered that it was already correct in re_bytes, but I think the new lifetime names are more consistent, so I changed to 'c there.

The 'c' lifetime in the iter_pos definitions is elidable, I can do it that way if you prefer.

So that strings extracted from a Captures::iter[_named]() can be used
after the captures struct is dropped.
@BurntSushi
Copy link
Member

BurntSushi commented Apr 26, 2016

@birkenfeld Thanks! This is issue #168. When I wrote the bytes API, I fixed this issue. However, the addition of a type parameter to a public type is a breaking change, so I'm holding off on making this change until the next semver bump.

@birkenfeld
Copy link
Author

Ah right. I was only thinking about the methods, where there is no breakage, but the type change itself is indeed incompatible.

Well, I guess you'll make a 0.2 (or 1.0?) bump eventually.

@birkenfeld birkenfeld closed this Apr 26, 2016
@BurntSushi
Copy link
Member

@birkenfeld Yeah, #168 is on the 1.0 milestone. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants