-
Notifications
You must be signed in to change notification settings - Fork 15
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
path type different than std::fs::File #34
Comments
This is true. Maybe we should qualify this statement with an asterisk and explain how we differ? Alternatively, maybe we should change our bounds to either |
I also hit this, and had to rework some code. I'm guessing the error types need to own the path and that's why this is done? |
Is it really necessary that the error should own the path? Can't it just store the reference to the path instead? |
@TonalidadeHidrica The error must own the path, it cannot be a reference because that would make both the wrapper and the error non- This issue should probably be resolved by a PR that improves the docs to explain this, and show how to change the code that doesn't compile due to the difference. (The change is trivial, but can be perplexing to a newbie.) |
Its worth noting that all uses of I'd be happy to accept a PR to improve docs around this |
std::fs::File uses
AsRef<Path>
as the type for passing paths while fs_err usesInto<PathBuf>
This makes fs_err not be a "drop in replacement": When I pass an
AsRef<Path>
to fs_err::File::open, it does not compileThe text was updated successfully, but these errors were encountered: