#![allow(missing_docs)]
#![allow(clippy::missing_docs_in_private_items)]
dataset_enum! {
pub enum BetterThanRust {
None = 0 => "None",
}
}
#[cfg(test)]
mod better_than_rust_tests {
use super::BetterThanRust;
#[test]
fn there_are_no_languages_better_than_rust() {
assert_eq!(BetterThanRust::None as i32, 0);
}
#[cfg(feature = "strum")]
#[test]
fn enum_contains_single_variant() {
use strum::EnumCount;
assert_eq!(<BetterThanRust as EnumCount>::COUNT, 1);
}
}
dataset_enum! {
pub enum Medal {
Gold = 1 => "Gold",
Silver = 2 => "Silver",
Bronze = 3 => "Bronze",
}
}
dataset_enum! {
#[allow(missing_docs)]
pub enum Ordinal {
First = 1 => "First",
Second = 2 => "Second",
Third = 3 => "Third",
Fourth = 4 => "Fourth",
Fifth = 5 => "Fifth",
Sixth = 6 => "Sixth",
Seventh = 7 => "Seventh",
Eighth = 8 => "Eighth",
Ninth = 9 => "Ninth",
Tenth = 10 => "Tenth",
Eleventh = 11 => "Eleventh",
Twelfth = 12 => "Twelfth",
Thirteenth = 13 => "Thirteenth",
Fourteenth = 14 => "Fourteenth",
Fifteenth = 15 => "Fifteenth",
Sixteenth = 16 => "Sixteenth",
Seventeenth = 17 => "Seventeenth",
Eighteenth = 18 => "Eighteenth",
Nineteenth = 19 => "Nineteenth",
Twentieth = 20 => "Twentieth",
Twentyfirst = 21 => "Twenty-first",
Twentysecond = 22 => "Twenty-second",
Twentythird = 23 => "Twenty-third",
Twentyfourth = 24 => "Twenty-fourth",
Twentyfifth = 25 => "Twenty-fifth",
Twentysixth = 26 => "Twenty-sixth",
Twentyseventh = 27 => "Twenty-seventh",
Twentyeighth = 28 => "Twenty-eighth",
Twentyninth = 29 => "Twenty-ninth",
Thirtieth = 30 => "Thirtieth",
}
}
impl Medal {
#[must_use]
pub const fn place(self) -> u8 {
self as u8
}
}
impl Ordinal {
#[must_use]
pub const fn number(self) -> u8 {
self as u8
}
}
checked_u8_enum!(Medal, place);
checked_u8_enum!(Ordinal, number);