#[test] fn from_str_err() { "abc".parse::<Rarity>().unwrap_err(); "".parse::<Rarity>().unwrap_err(); } #[test] fn conversions_with_u8() { for &expected in &[ Rarity::Common, Rarity::Uncommon, Rarity::Rare, Rarity::Epic, Rarity::Legendary, Rarity::Mythic, ] { let n: u8 = expected.into(); let actual = Rarity::try_from(n).unwrap(); assert_eq!(actual, expected); } assert_eq!(Rarity::try_from(6), Err(6)); } }
Inscription number 44,990,891
Genesis block 819,073
File type text
File size 502 b
Creation date Nov 30,2023 4:28 am