-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Implemented remaining string pattern API #23952
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
☔ The latest upstream changes (presumably #23955) made this pull request unmergeable. Please resolve the merge conflicts. |
ee8c14a
to
bfa1cab
Compare
/// | ||
/// The returned iterator will be double ended if the pattern allows a reverse search | ||
/// and forward/reverse search yields the same elements. This is true for, eg, `char` but not | ||
/// for `&str`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much of the surrounding style of documentation in this file is to wrap to 80 chars, could you also do that here?
Overall this looks good to me, but I'm finding it very difficult to follow with the large amount of macros being used, would you mind trying to reduce the number of macros in use? I think some extra verboseness is fine here as we're not really trying to optimize for disk space with the source code! |
83bb01a
to
76fad7e
Compare
- Added missing reverse versions of methods - Added [r]matches() - Generated the string pattern iterators with a macro - Added where bounds to the methods returning reverse iterators for better error messages.
Fixed bug in existing StrSearcher impl
76fad7e
to
fbba28e
Compare
This adds the missing methods and turns `str::pattern` in a user facing module, as per RFC. This also contains some big internal refactorings: - string iterator pairs are implemented with a central macro to reduce redundancy - Moved all tests from `coretest::str` into `collectionstest::str` and left a note to prevent the two sets of tests drifting apart further. See #22477
This adds the missing methods and turns
str::pattern
in a user facing module, as per RFC.This also contains some big internal refactorings:
coretest::str
intocollectionstest::str
and left a note to prevent the two sets of tests drifting apart further.See #22477