You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm thinking about using IsVariant to replace a set of manual methods I'd previously implemented:
I was happy to see that the methods were already const, but they could still be made #[must_use]! The reason it's in my code is because I got a pedantic clippy lint about it, but since bools don't implement Drop and exist only to be eventually used (these static methods have no "side effects"), I think it's safe and reasonable to add this annotation! As I understand, this is what the standard library does for Result.
I think this would, technically, be a breaking change, so it might be good to get into 1.0, but I'm happy to quickly whip up a PR if you think this is a worthwhile addition!
Just let me know and I can get to work!
The text was updated successfully, but these errors were encountered:
## Synopsis & Solution
Adds a `#[must_use]` annotation to the static methods generated by
`IsVariant`. I also refactored the derive to use `matches!(...)` instead
of a manual `match` block with bools, but that's just a style tweak.
I'm thinking about using
IsVariant
to replace a set of manual methods I'd previously implemented:I was happy to see that the methods were already
const
, but they could still be made#[must_use]
! The reason it's in my code is because I got a pedantic clippy lint about it, but sincebool
s don't implementDrop
and exist only to be eventually used (these static methods have no "side effects"), I think it's safe and reasonable to add this annotation! As I understand, this is what the standard library does forResult
.I think this would, technically, be a breaking change, so it might be good to get into 1.0, but I'm happy to quickly whip up a PR if you think this is a worthwhile addition!
Just let me know and I can get to work!
The text was updated successfully, but these errors were encountered: