-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Add String::into_boxed_slice and Box<str>::into_string #26931
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
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
src/libcollectionstest/str.rs
Outdated
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.
acquite acquire
f8b9f64 to
17c914e
Compare
|
Responded to feedback in the newest commit. Updated a typo, and use |
src/libcollections/string.rs
Outdated
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.
nit: backticks
1520bc0 to
3509b13
Compare
|
Thanks! @bors r+ |
|
📌 Commit 3509b13 has been approved by |
src/libcollections/str.rs
Outdated
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 may be best implemented compositionally with a transmute, <[_]>::into_vec plus String::from_utf8_unchecked, that way there's no need to worry about the raw parts being exactly what we want, and there's exactly one point of Box<[T]> to Vec<T> (into_vec)
|
@bors: r- (just some minor nits about the implementation, but follow ups are hard...) |
Implements merged RFC 1152. Closes rust-lang#26697.
|
@alexcrichton updated with suggested refactor - I actually thought of doing it that way the first time, but decided on the more manual route to avoid transmuting |
Implements merged RFC 1152. Closes #26697.
|
I want to rename this method, see Rename String::into_boxed_slice -> into_boxed_str #27696 |
Implements merged RFC 1152.
Closes #26697.