]>
git.proxmox.com Git - rustc.git/blob - src/doc/book/listings/ch18-patterns-and-matching/listing-18-15/src/main.rs
3 Move { x: i32, y: i32 }
,
5 ChangeColor(i32, i32, i32),
9 let msg
= Message
::ChangeColor(0, 160, 255);
13 println
!("The Quit variant has no data to destructure.")
15 Message
::Move { x, y }
=> {
17 "Move in the x direction {} and in the y direction {}",
21 Message
::Write(text
) => println
!("Text message: {}", text
),
22 Message
::ChangeColor(r
, g
, b
) => println
!(
23 "Change the color to red {}, green {}, and blue {}",