@@ -20,19 +20,31 @@ LL | if let V6(_) = V6(Ipv6Addr::LOCALHOST) {}
2020 | -------^^^^^-------------------------- help: try: `if V6(Ipv6Addr::LOCALHOST).is_ipv6()`
2121
2222error: redundant pattern matching, consider using `is_ipv4()`
23- --> $DIR/redundant_pattern_matching_ipaddr.rs:21:15
23+ --> $DIR/redundant_pattern_matching_ipaddr.rs:22:8
24+ |
25+ LL | if matches!(V4(Ipv4Addr::LOCALHOST), V4(_)) {}
26+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `V4(Ipv4Addr::LOCALHOST).is_ipv4()`
27+
28+ error: redundant pattern matching, consider using `is_ipv6()`
29+ --> $DIR/redundant_pattern_matching_ipaddr.rs:25:8
30+ |
31+ LL | if matches!(V6(Ipv6Addr::LOCALHOST), V6(_)) {}
32+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `V6(Ipv6Addr::LOCALHOST).is_ipv6()`
33+
34+ error: redundant pattern matching, consider using `is_ipv4()`
35+ --> $DIR/redundant_pattern_matching_ipaddr.rs:27:15
2436 |
2537LL | while let V4(_) = V4(Ipv4Addr::LOCALHOST) {}
2638 | ----------^^^^^-------------------------- help: try: `while V4(Ipv4Addr::LOCALHOST).is_ipv4()`
2739
2840error: redundant pattern matching, consider using `is_ipv6()`
29- --> $DIR/redundant_pattern_matching_ipaddr.rs:23 :15
41+ --> $DIR/redundant_pattern_matching_ipaddr.rs:29 :15
3042 |
3143LL | while let V6(_) = V6(Ipv6Addr::LOCALHOST) {}
3244 | ----------^^^^^-------------------------- help: try: `while V6(Ipv6Addr::LOCALHOST).is_ipv6()`
3345
3446error: redundant pattern matching, consider using `is_ipv4()`
35- --> $DIR/redundant_pattern_matching_ipaddr.rs:33 :5
47+ --> $DIR/redundant_pattern_matching_ipaddr.rs:39 :5
3648 |
3749LL | / match V4(Ipv4Addr::LOCALHOST) {
3850LL | | V4(_) => true,
@@ -41,7 +53,7 @@ LL | | };
4153 | |_____^ help: try: `V4(Ipv4Addr::LOCALHOST).is_ipv4()`
4254
4355error: redundant pattern matching, consider using `is_ipv6()`
44- --> $DIR/redundant_pattern_matching_ipaddr.rs:38 :5
56+ --> $DIR/redundant_pattern_matching_ipaddr.rs:44 :5
4557 |
4658LL | / match V4(Ipv4Addr::LOCALHOST) {
4759LL | | V4(_) => false,
@@ -50,7 +62,7 @@ LL | | };
5062 | |_____^ help: try: `V4(Ipv4Addr::LOCALHOST).is_ipv6()`
5163
5264error: redundant pattern matching, consider using `is_ipv6()`
53- --> $DIR/redundant_pattern_matching_ipaddr.rs:43 :5
65+ --> $DIR/redundant_pattern_matching_ipaddr.rs:49 :5
5466 |
5567LL | / match V6(Ipv6Addr::LOCALHOST) {
5668LL | | V4(_) => false,
@@ -59,7 +71,7 @@ LL | | };
5971 | |_____^ help: try: `V6(Ipv6Addr::LOCALHOST).is_ipv6()`
6072
6173error: redundant pattern matching, consider using `is_ipv4()`
62- --> $DIR/redundant_pattern_matching_ipaddr.rs:48 :5
74+ --> $DIR/redundant_pattern_matching_ipaddr.rs:54 :5
6375 |
6476LL | / match V6(Ipv6Addr::LOCALHOST) {
6577LL | | V4(_) => true,
@@ -68,49 +80,49 @@ LL | | };
6880 | |_____^ help: try: `V6(Ipv6Addr::LOCALHOST).is_ipv4()`
6981
7082error: redundant pattern matching, consider using `is_ipv4()`
71- --> $DIR/redundant_pattern_matching_ipaddr.rs:53 :20
83+ --> $DIR/redundant_pattern_matching_ipaddr.rs:59 :20
7284 |
7385LL | let _ = if let V4(_) = V4(Ipv4Addr::LOCALHOST) {
7486 | -------^^^^^-------------------------- help: try: `if V4(Ipv4Addr::LOCALHOST).is_ipv4()`
7587
7688error: redundant pattern matching, consider using `is_ipv4()`
77- --> $DIR/redundant_pattern_matching_ipaddr.rs:61 :20
89+ --> $DIR/redundant_pattern_matching_ipaddr.rs:67 :20
7890 |
7991LL | let _ = if let V4(_) = gen_ipaddr() {
8092 | -------^^^^^--------------- help: try: `if gen_ipaddr().is_ipv4()`
8193
8294error: redundant pattern matching, consider using `is_ipv6()`
83- --> $DIR/redundant_pattern_matching_ipaddr.rs:63 :19
95+ --> $DIR/redundant_pattern_matching_ipaddr.rs:69 :19
8496 |
8597LL | } else if let V6(_) = gen_ipaddr() {
8698 | -------^^^^^--------------- help: try: `if gen_ipaddr().is_ipv6()`
8799
88100error: redundant pattern matching, consider using `is_ipv4()`
89- --> $DIR/redundant_pattern_matching_ipaddr.rs:75 :12
101+ --> $DIR/redundant_pattern_matching_ipaddr.rs:81 :12
90102 |
91103LL | if let V4(_) = V4(Ipv4Addr::LOCALHOST) {}
92104 | -------^^^^^-------------------------- help: try: `if V4(Ipv4Addr::LOCALHOST).is_ipv4()`
93105
94106error: redundant pattern matching, consider using `is_ipv6()`
95- --> $DIR/redundant_pattern_matching_ipaddr.rs:77 :12
107+ --> $DIR/redundant_pattern_matching_ipaddr.rs:83 :12
96108 |
97109LL | if let V6(_) = V6(Ipv6Addr::LOCALHOST) {}
98110 | -------^^^^^-------------------------- help: try: `if V6(Ipv6Addr::LOCALHOST).is_ipv6()`
99111
100112error: redundant pattern matching, consider using `is_ipv4()`
101- --> $DIR/redundant_pattern_matching_ipaddr.rs:79 :15
113+ --> $DIR/redundant_pattern_matching_ipaddr.rs:85 :15
102114 |
103115LL | while let V4(_) = V4(Ipv4Addr::LOCALHOST) {}
104116 | ----------^^^^^-------------------------- help: try: `while V4(Ipv4Addr::LOCALHOST).is_ipv4()`
105117
106118error: redundant pattern matching, consider using `is_ipv6()`
107- --> $DIR/redundant_pattern_matching_ipaddr.rs:81 :15
119+ --> $DIR/redundant_pattern_matching_ipaddr.rs:87 :15
108120 |
109121LL | while let V6(_) = V6(Ipv6Addr::LOCALHOST) {}
110122 | ----------^^^^^-------------------------- help: try: `while V6(Ipv6Addr::LOCALHOST).is_ipv6()`
111123
112124error: redundant pattern matching, consider using `is_ipv4()`
113- --> $DIR/redundant_pattern_matching_ipaddr.rs:83 :5
125+ --> $DIR/redundant_pattern_matching_ipaddr.rs:89 :5
114126 |
115127LL | / match V4(Ipv4Addr::LOCALHOST) {
116128LL | | V4(_) => true,
@@ -119,13 +131,13 @@ LL | | };
119131 | |_____^ help: try: `V4(Ipv4Addr::LOCALHOST).is_ipv4()`
120132
121133error: redundant pattern matching, consider using `is_ipv6()`
122- --> $DIR/redundant_pattern_matching_ipaddr.rs:88 :5
134+ --> $DIR/redundant_pattern_matching_ipaddr.rs:94 :5
123135 |
124136LL | / match V6(Ipv6Addr::LOCALHOST) {
125137LL | | V4(_) => false,
126138LL | | V6(_) => true,
127139LL | | };
128140 | |_____^ help: try: `V6(Ipv6Addr::LOCALHOST).is_ipv6()`
129141
130- error: aborting due to 18 previous errors
142+ error: aborting due to 20 previous errors
131143
0 commit comments