Closed saschagrunert closed 3 years ago
Thanks for the report. I did use strum
previously in some other projects and, at the time, decided against using it here for several reasons:
So overall, unless this is solving some specific problem, I'd keep my original position and say it is not worth it.
Additionally, here there could be an implicit request of having multiple canonical names for a variant (i.e. CAP_
-prefix and non-prefixed). Let me know if you further need to touch on that or if was just an example, but for that one too I'd say it is a wrong direction at the level of this library (security-wise, for sane input validation - but can be freely done by consumers).
Alright, thank you for the input, closing this one now.
The idea is to use the strum crate to be able to make the
Capability
enum more compact and Rusty. This means that we could reduce this:https://github.com/lucab/caps-rs/blob/cb54844125d9dd6de51d6c8c8a951aefbd0d3904/src/lib.rs#L75-L77
to
We already use this method in containrs, which is a WIP project: https://github.com/cri-o/containrs/blob/master/src/capability.rs
Do you think this makes sense?