3 #![warn(clippy::match_single_binding)]
4 #![allow(unused_variables)]
7 // Lint (additional curly braces needed, see #6572)
12 inner: Option<(I, <I as Iterator>::Item)>,
16 fn size_hint<I: Iterator>(iter: &AppendIter<I>) -> (usize, Option<usize>) {
18 Some((iter, _item)) => match iter.size_hint() {
19 (min, max) => (min.saturating_add(1), max.and_then(|max| max.checked_add(1))),
25 // Lint (no additional curly braces needed)
26 let opt = Some((5, 2));
27 let get_tup = || -> (i32, i32) { (1, 2) };
30 Some((first, _second)) => {
32 (a, b) => println!("a {:?} and b {:?}", a, b),
35 None => println!("nothing"),
40 // Lint (scrutinee has side effects)
42 match side_effects() {
43 _ => println!("Side effects"),
46 // Lint (scrutinee has side effects)
53 _ => println!("Single branch"),