1error: you don't need to add `&` to all patterns 2 --> $DIR/match_ref_pats.rs:7:9 3 | 4LL | / match v { 5LL | | &Some(v) => println!("{:?}", v), 6LL | | &None => println!("none"), 7LL | | } 8 | |_________^ 9 | 10 = note: `-D clippy::match-ref-pats` implied by `-D warnings` 11help: instead of prefixing all patterns with `&`, you can dereference the expression 12 | 13LL ~ match *v { 14LL ~ Some(v) => println!("{:?}", v), 15LL ~ None => println!("none"), 16 | 17 18error: you don't need to add `&` to both the expression and the patterns 19 --> $DIR/match_ref_pats.rs:24:5 20 | 21LL | / match &w { 22LL | | &Some(v) => println!("{:?}", v), 23LL | | &None => println!("none"), 24LL | | } 25 | |_____^ 26 | 27help: try 28 | 29LL ~ match w { 30LL ~ Some(v) => println!("{:?}", v), 31LL ~ None => println!("none"), 32 | 33 34error: redundant pattern matching, consider using `is_none()` 35 --> $DIR/match_ref_pats.rs:36:12 36 | 37LL | if let &None = a { 38 | -------^^^^^---- help: try this: `if a.is_none()` 39 | 40 = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings` 41 42error: redundant pattern matching, consider using `is_none()` 43 --> $DIR/match_ref_pats.rs:41:12 44 | 45LL | if let &None = &b { 46 | -------^^^^^----- help: try this: `if b.is_none()` 47 48error: you don't need to add `&` to all patterns 49 --> $DIR/match_ref_pats.rs:101:9 50 | 51LL | / match foobar_variant!(0) { 52LL | | &FooBar::Foo => println!("Foo"), 53LL | | &FooBar::Bar => println!("Bar"), 54LL | | &FooBar::FooBar => println!("FooBar"), 55LL | | _ => println!("Wild"), 56LL | | } 57 | |_________^ 58 | 59help: instead of prefixing all patterns with `&`, you can dereference the expression 60 | 61LL ~ match *foobar_variant!(0) { 62LL ~ FooBar::Foo => println!("Foo"), 63LL ~ FooBar::Bar => println!("Bar"), 64LL ~ FooBar::FooBar => println!("FooBar"), 65 | 66 67error: aborting due to 5 previous errors 68 69