fn destructure_enums() {
    let msg = Message::ChangeColor(0, 160, 255);

    match msg {
        Message::Quit => {
            println!("The Quit variant has no data to destructure.")
        }
        Message::Move { x, y } => {
            println!("Move in the x direction {} and in the y direction {}", x, y);
        }
        Message::Write(text) => println!("Text message: {}", text),
        Message::ChangeColor(r, g, b) => println!("Change the color to red {}, green {}, and blue {}", r, g, b),
    }
}
// Destructuring enum variants that hold different kinds of values.
Destructuring enum variants that hold different kinds of values.
Destructuring enum variants that hold different kinds of values .
fn destructure_enums() {
    let msg = Message::ChangeColor(0, 160, 255);
    match msg {
        Message::Quit => {
            println!("The Quit variant has no data to destructure.")
        }
        Message::Move { x, y } => {
            println!("Move in the x direction {} and in the y direction {}", x, y);
        }
        Message::Write(text) => println!("Text message: {}", text),
        Message::ChangeColor(r, g, b) => println!("Change the color to red {}, green {}, and blue {}", r, g, b),
    }
}
fn destructure_enums ( ) { let msg = Message :: ChangeColor ( 0 , 160 , 255 ) ; match msg { Message :: Quit => { println ! ( " " ) } Message :: Move { x , y } => { println ! ( " " x y ) ; } Message :: Write ( text ) => println ! ( " " text ) , Message :: ChangeColor ( r , g , b ) => println ! ( " " r g b ) , } }
Destructuring enum variants that hold different kinds of values.
Destructuring enum variants that hold different kinds of values .