-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add str::split_ascii_whitespace. #49987
Conversation
r? @bluss (rust_highfive has picked a reviewer for you, use r? to override) |
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
74f35d1
to
d02886d
Compare
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Does this need to be standard lib? |
@jcarres-mdsol Methods are sorted in the order they're defined, and I'd really rather not have |
☔ The latest upstream changes (presumably #49896) made this pull request unmergeable. Please resolve the merge conflicts. |
Ping from triage @clarcharr! There are conflicts that needs to be resolved, and the tests are currently failing. |
d02886d
to
1fbbdbd
Compare
Rebased! Sorry it took so long. |
This comment has been minimized.
This comment has been minimized.
1fbbdbd
to
838d878
Compare
This comment has been minimized.
This comment has been minimized.
838d878
to
16a4681
Compare
This comment has been minimized.
This comment has been minimized.
16a4681
to
6900800
Compare
This comment has been minimized.
This comment has been minimized.
6900800
to
20a35cd
Compare
This comment has been minimized.
This comment has been minimized.
20a35cd
to
57ae991
Compare
This comment has been minimized.
This comment has been minimized.
57ae991
to
f705cb8
Compare
(This is ready for review @bluss) |
Ping from triage, @bluss / @rust-lang/libs, this PR needs your review. |
Ping from triage! This PR needs a review, can @bluss or someone else from @rust-lang/libs review this? |
Ping from triage! It's more than 20 days since this PR needed a review. Can @bluss or someone else from @rust-lang/libs review this? |
src/libcore/str/mod.rs
Outdated
|
||
impl<'a> FnMut<(&'a [u8], )> for BytesToStr { | ||
#[inline] | ||
extern "rust-call" fn call_mut(&mut self, arg: (&'a [u8], )) -> &'a 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.
This really should be an unsafe fn
, but unfortunately that’s not supported by the Fn*
traits. It’s not essential though since this is a private type.
Maybe renaming the type to UncheckedBytesToStr
and adding a comment that it is unsafe to use? Feel free to submit another PR for this, I’ll r+ this one now so that it doesn’t bitrot again.
@bors r+ |
📌 Commit 0ce3ea2c968a64b382aed9ee26f59c1db158eb2c has been approved by |
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
@clarcharr could you please rebase on top of the latest master, even if you don't see any conflict? Thanks! |
Will do! Also I'll make the change @SimonSapin suggested. IMHO these should really be using |
Can |
@SimonSapin Through some form of |
0ce3ea2
to
b5cee02
Compare
Also, rebased. |
@bors r+ |
📌 Commit b5cee02 has been approved by |
…=SimonSapin Add str::split_ascii_whitespace. As mentioned in rust-lang#48656. While `str::split_whitespace` now works in `libcore`, it still makes sense to offer this method, considering how it is still more performant in cases where only ASCII is necessary.
Rollup of 7 pull requests Successful merges: - #49987 (Add str::split_ascii_whitespace.) - #50342 (Document round-off error in `.mod_euc()`-method, see issue #50179) - #51658 (Only do sanity check with debug assertions on) - #51799 (Lower case some feature gate error messages) - #51800 (Add a compiletest header for edition) - #51824 (Fix the error reference for LocalKey::try_with) - #51842 (Document that Layout::from_size_align does not allow align=0) Failed merges: r? @ghost
As mentioned in #48656.
While
str::split_whitespace
now works inlibcore
, it still makes sense to offer this method, considering how it is still more performant in cases where only ASCII is necessary.