Task

Create an enumeration of constants with and without explicit values.




enum Fruits {
    Apple,
    Banana,
    Cherry
}
 
enum FruitsWithNumbers {
    Strawberry = 0,
    Pear = 27,
}
 
fn main() {
    // Access to numerical value by conversion
    println!("{}", FruitsWithNumbers::Pear as u8);
}