lucab / caps-rs

A pure-Rust library to work with Linux capabilities
https://docs.rs/caps
Other
83 stars 20 forks source link

Remove dependency on `errno` crate in favor of std functions #78

Closed thesecretmaster closed 2 years ago

thesecretmaster commented 2 years ago

Unsure if there was a reason for the decision to use the errno crate, but if you just need error printing std::io::Error::last_os_error() will do basically the same thing afaik.

lucab commented 2 years ago

Thanks for the PR. I'd need to dig through history to double-check and confirm, but I seem to remember that errno was introduced at a point where this library was directly exposing those codes to consumers in errors. As we are now using opaque errors instead, I think we should be able to drop the errno dependency. Can you please squash the commits into a single one?

thesecretmaster commented 2 years ago

Done!

thesecretmaster commented 2 years ago

And yes, it was introduced in https://github.com/lucab/caps-rs/commit/49cf9e23052939e923fbd931a1dd8dcef1408557 which does expose the errors to consumers of the library. Thanks for the correction.

thesecretmaster commented 2 years ago

Any update on the state of this PR @lucab? I'd love to get this merged so that I can stop pulling it from git when I use it.