mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-16 11:16:45 -04:00
TryFrom on enums should use anyhow::Error as the error type
This commit is contained in:
parent
3cd834b385
commit
d465bc2750
4 changed files with 16 additions and 16 deletions
|
@ -34,7 +34,7 @@ macro_rules! enum_roundtrip {
|
|||
};
|
||||
($enum:ident => $value:literal : $ty:ty = $variant:ident) => {
|
||||
assert_eq!($enum::$variant as $ty, $value);
|
||||
assert_eq!($enum::try_from($value), Ok($enum::$variant));
|
||||
assert_eq!($enum::try_from($value).unwrap(), $enum::$variant);
|
||||
};
|
||||
|
||||
($enum:ident { $($value:literal : $ty:ident = $variant:ident,)+ }) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue