Skip to content

Conversation

@BurntSushi
Copy link
Member

This rolls up several PRs with minor touchups that have been outstanding for a while. We also fix CI by re-applying rustfmt.

BurntSushi and others added 11 commits January 9, 2020 12:22
PR #633 removed these methods, but we can't do that without making a
breaking change release. Removing deprecated methods isn't worth doing a
breaking change release, so we instead simply allow them for now by
squashing the warnings.

Closes #633
This makes it more convenient to express matches as ranges, which in
turn can be used for indexing slices.
This builds on top of the previous commit which adds a new `range`
method to the `Match` types.

Closes #631
Corrects `/-/.split("a-")` to return `["a", ""]` instead of `["a"]`.
(`/-/` is shorthand for `Regex::new("-").unwrap()`.)

This adds tests for both `split()` and `splitn()` covering a variety of
edge cases. One test is commented out because it is failing due to #521.
A future commit will fix it.

Note that the `split2` and `split3` tests were passing incorrectly
before this change. I have fixed them to expect the correct values.

Fixes #627
Corrects `/-/.splitn("a", 2)` to return `["a"]` instead of `["a", ""]`.
(`/-/` is shorthand for `Regex::new("-").unwrap()`.)

Fixes #521, Closes #606, Closes #628
@BurntSushi BurntSushi merged commit 65d6bba into master Jan 9, 2020
@BurntSushi BurntSushi deleted the ag/updates branch January 9, 2020 19:27
@rust-lang rust-lang deleted a comment Feb 6, 2025
@rust-lang rust-lang deleted a comment Feb 6, 2025
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.

5 participants