-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Add is_whitespace and is_alphanumeric to str. #49381
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
The other methods from `UnicodeStr` are already stable inherent methods on str, but these have not been included.
Looks good. @bors: r+ |
📌 Commit 1e2458e has been approved by |
@bors r=SimonSapin |
📌 Commit 5fc7e0a has been approved by |
@bors rollup |
Add is_whitespace and is_alphanumeric to str. The other methods from `UnicodeStr` are already stable inherent methods on str, but these have not been included. r? @SimonSapin
Is there a reason why these methods are not available on core? Is there anything inherently preventing them from being available there? |
These methods are based on (potentially-large) Unicode tables. The |
When we were talking about which methods from I mean, the meaning of |
That’s a good point. @rust-lang/libs, any opinion? |
I also personally like the explicit variant to the exclusion of the higher level methods. Basically for reasons already stated. |
I would prefer not to have these methods. |
I filed #49657 with regression-from-stable-to-beta tag to follow up. @LukasKalbertodt I'm not sure how you caught this but thanks! 🍻 |
@dtolnay In case that's not a rhetoric question: this PR was linked on TWiR. I only landed one big PR in this repo (the |
This commit tweaks a few stable APIs in the `beta` branch before they hit stable. The `str::is_whitespace` and `str::is_alphanumeric` functions were deleted (added in rust-lang#49381, issue at rust-lang#49657). The `and_modify` APIs added in rust-lang#44734 were altered to take a `FnOnce` closure rather than a `FnMut` closure. Closes rust-lang#49581 Closes rust-lang#49657
This commit tweaks a few stable APIs in the `beta` branch before they hit stable. The `str::is_whitespace` and `str::is_alphanumeric` functions were deleted (added in rust-lang#49381, issue at rust-lang#49657). The `and_modify` APIs added in rust-lang#44734 were altered to take a `FnOnce` closure rather than a `FnMut` closure. Closes rust-lang#49581 Closes rust-lang#49657
Tweak some stabilizations in libstd This commit tweaks a few stable APIs in the `beta` branch before they hit stable. The `str::is_whitespace` and `str::is_alphanumeric` functions were deleted (added in #49381, issue at #49657). The `and_modify` APIs added in #44734 were altered to take a `FnOnce` closure rather than a `FnMut` closure. Closes #49581 Closes #49657
The other methods from
UnicodeStr
are already stable inherentmethods on str, but these have not been included.
r? @SimonSapin