Advertisement
cwchen

[Rust] match demo (with error)

Aug 22nd, 2017
609
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.25 KB | None | 0 0
  1. fn main() {
  2.     let grade = "A";
  3.  
  4.     match grade {
  5.         "A" => println!("Wonderful"),
  6.         "B" => println!("Good"),
  7.         "C" => println!("So so"),
  8.         "D" => println!("It could be better"),
  9.         "F" => println!("Oh, oh"),
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement