Skip to content
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

Should cap-std have its own Path type? #88

Closed
sunfishcode opened this issue Jul 30, 2020 · 4 comments
Closed

Should cap-std have its own Path type? #88

sunfishcode opened this issue Jul 30, 2020 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@sunfishcode
Copy link
Member

Is it worth defining Path, PathBuf and associated types in cap-std? They could mostly be thin wrappers around their std::path counterparts, but they'd omit several ambient-authority methods: metadata, read_link, read_dir, symlink_metadata, and canonicalize.

@sunfishcode sunfishcode added the question Further information is requested label Jul 31, 2020
@sunfishcode sunfishcode self-assigned this Jan 6, 2021
@sunfishcode
Copy link
Member Author

sunfishcode commented Jan 6, 2021

I brought up the idea of deprecating the functions in question here, and have now posted a PR to deprecate them.

@sunfishcode
Copy link
Member Author

Sounds like deprecating them is not the way to go here, so I'm now thinking about a custom Path type. A linting system is another option (see also #130).

@sunfishcode
Copy link
Member Author

camino is a neat crate providing a Utf8Path type, which might be nice to use for cap_std::fs_utf8. And of course, it also has the filesystem convenience functions. If cap-std defines its own Path to exclude these functions, and continues following the philosophy of reflecting std as much as possible, that might imply that cap-std should have its own version of Utf8Path too, to similarly exclude these functions.

Approaching this with linting is sounding increasingly sensible.

@sunfishcode
Copy link
Member Author

With the ambient authority linter available now, I think the answer here is that cap-std does not need its own Path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant