-
Notifications
You must be signed in to change notification settings - Fork 7
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
Interopting with std::path::Path
#28
Comments
Hey there! Thanks for reaching out :) I took a look and the Been awhile since I took a look, so maybe there's a cleaner way to do this now. :) |
Oh, I see. Indeed, I'm happy to make a PR for this if I find the time. Wanted to make sure I wasn't missing something. |
One thing to keep in mind is that For my personal use case, I leverage this library specifically to have a platform-agnostic way to share paths over a network; so, if this library ends up leveraging the conversion to-and-from encoded bytes, there will need to be a disclaimer since it would cause issues for those like me that didn't realize this constraint. |
Hey there, excellent library. I'm wondering if there is a recommended way to convert back and forth between the
std::path::Path
andstd::path::PathBuf
types.It's nice to store types as
Utf8NativePath
, because that has anAsRef<std::path::Path>
. That type can easily be passed into other libraries that expect the std path types.However, it seems quite cumbersome to create that from an std path:
It seems to me that
NativePath
should have aFrom<std::path::Path>
, sincefrom_bytes_path
is is infallable, andUtf8NativePath
should have a fallableTryFrom<std::path::Path>
withUtf8Error
.The library does an amazing job documenting and interopting with itself, but much of the Rust ecosystem uses std path, so I find this library hard to work with practically. Perhaps I missed something obvious?
Thanks for your time!
The text was updated successfully, but these errors were encountered: