-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
There is no way to create a PathBuf from an OsString without copying #22751
Comments
Yep, just an oversight. |
Just add |
I think that this would probably be done by changing the |
cc me. I need this. |
Nominating, I think this should be done before 1.0 as it may be a confusing omission. |
1.0 beta, P-backcompat-libs (but only b/c @aturon said he's got a patch ready to go) |
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes rust-lang#22751 Closes rust-lang#14433 [breaking-change]
PathBuf
doesn't expose any methods that can be used to create aPathBuf
from anOsString
(or anything convertible to anOsString
) without copying. This seems like an unnecessary limitation./cc @aturon
The text was updated successfully, but these errors were encountered: