3 #![warn(clippy::match_single_binding)]
4 #![allow(unused_variables, clippy::many_single_char_names, clippy::toplevel_ref_arg)]
11 fn coords() -> Point {
18 _ => println!("whatever"),
30 println!("{} {} {}", x, y, z);
35 (x, y, z) => println!("{} {} {}", x, y, z),
42 _ => println!("Not 2"),
47 Some(d) => println!("{}", d),
48 _ => println!("None"),
52 _ => println!("whatever"),
58 println!("x has a value of {}", x);
66 println!("e is superior to 5");
71 let p = Point { x: 0, y: 7 };
73 Point { x, y } => println!("Coords: ({}, {})", x, y),
77 Point { x: x1, y: y1 } => println!("Coords: ({}, {})", x1, y1),
82 ref r => println!("Got a reference to {}", r),
87 ref mut mr => println!("Got a mutable reference to {}", mr),
90 let product = match coords() {
91 Point { x, y } => x * y,
94 let v = vec![Some(1), Some(2), Some(3), Some(4)];
95 #[allow(clippy::let_and_return)]
98 .map(|i| match i.unwrap() {
99 unwrapped => unwrapped,
101 .collect::<Vec<u8>>();