2017-02-07 21:05:30 +01:00
|
|
|
error: you don't need to add `&` to all patterns
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:26:9
|
2018-04-05 21:18:38 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
26 | / match v {
|
|
|
|
27 | | &Some(v) => println!("{:?}", v),
|
|
|
|
28 | | &None => println!("none"),
|
|
|
|
29 | | }
|
2018-04-05 21:18:38 +02:00
|
|
|
| |_________^
|
|
|
|
|
|
2018-08-01 16:30:44 +02:00
|
|
|
= note: `-D clippy::match-ref-pats` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
2018-04-05 21:18:38 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
26 | match *v {
|
|
|
|
27 | Some(v) => println!("{:?}", v),
|
|
|
|
28 | None => println!("none"),
|
2018-04-05 21:18:38 +02:00
|
|
|
|
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you don't need to add `&` to all patterns
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:36:5
|
2018-04-05 21:18:38 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
36 | / match tup {
|
|
|
|
37 | | &(v, 1) => println!("{}", v),
|
|
|
|
38 | | _ => println!("none"),
|
|
|
|
39 | | }
|
2018-04-05 21:18:38 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
2018-04-05 21:18:38 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
36 | match *tup {
|
|
|
|
37 | (v, 1) => println!("{}", v),
|
2018-04-05 21:18:38 +02:00
|
|
|
|
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you don't need to add `&` to both the expression and the patterns
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:42:5
|
2018-04-05 21:18:38 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
42 | / match &w {
|
|
|
|
43 | | &Some(v) => println!("{:?}", v),
|
|
|
|
44 | | &None => println!("none"),
|
|
|
|
45 | | }
|
2018-04-05 21:18:38 +02:00
|
|
|
| |_____^
|
2018-02-04 13:41:54 +01:00
|
|
|
help: try
|
2018-04-05 21:18:38 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
42 | match w {
|
|
|
|
43 | Some(v) => println!("{:?}", v),
|
|
|
|
44 | None => println!("none"),
|
2018-04-05 21:18:38 +02:00
|
|
|
|
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you don't need to add `&` to all patterns
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:53:5
|
2018-04-07 10:23:27 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
53 | / if let &None = a {
|
|
|
|
54 | | println!("none");
|
|
|
|
55 | | }
|
2018-04-07 10:23:27 +02:00
|
|
|
| |_____^
|
2017-02-07 21:05:30 +01:00
|
|
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
2018-04-07 10:23:27 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
53 | if let None = *a {
|
2018-05-29 10:56:58 +02:00
|
|
|
| ^^^^ ^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: you don't need to add `&` to both the expression and the patterns
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:58:5
|
2018-04-07 10:23:27 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
58 | / if let &None = &b {
|
|
|
|
59 | | println!("none");
|
|
|
|
60 | | }
|
2018-04-07 10:23:27 +02:00
|
|
|
| |_____^
|
2018-02-04 13:41:54 +01:00
|
|
|
help: try
|
2018-04-07 10:23:27 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
58 | if let None = b {
|
2018-05-29 10:56:58 +02:00
|
|
|
| ^^^^ ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2018-10-30 21:36:52 +01:00
|
|
|
error: Err(_) will match all errors, maybe not a good idea
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:69:9
|
2018-04-07 10:23:27 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
69 | Err(_) => panic!("err")
|
2018-10-30 21:36:52 +01:00
|
|
|
| ^^^^^^
|
2018-04-07 10:23:27 +02:00
|
|
|
|
|
2018-10-30 21:36:52 +01:00
|
|
|
= note: `-D clippy::match-wild-err-arm` implied by `-D warnings`
|
|
|
|
= note: to remove this warning, match each error separately or use unreachable macro
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2018-10-30 21:36:52 +01:00
|
|
|
error: this `match` has identical arm bodies
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:68:18
|
2018-04-07 10:23:27 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
68 | Ok(_) => println!("ok"),
|
2018-10-30 21:36:52 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
2018-04-07 10:23:27 +02:00
|
|
|
|
|
2018-10-30 21:36:52 +01:00
|
|
|
= note: `-D clippy::match-same-arms` implied by `-D warnings`
|
2017-09-12 14:25:58 +02:00
|
|
|
note: same as this
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:67:18
|
2018-10-30 21:36:52 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
67 | Ok(3) => println!("ok"),
|
2018-10-30 21:36:52 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 14:25:58 +02:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:67:18
|
2018-10-30 21:36:52 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
67 | Ok(3) => println!("ok"),
|
2018-10-30 21:36:52 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 14:25:58 +02:00
|
|
|
|
2017-02-11 07:57:50 +01:00
|
|
|
error: Err(_) will match all errors, maybe not a good idea
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:75:9
|
2018-10-30 21:36:52 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
75 | Err(_) => {panic!()}
|
2018-10-30 21:36:52 +01:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
= note: to remove this warning, match each error separately or use unreachable macro
|
2017-02-11 07:57:50 +01:00
|
|
|
|
2017-09-12 14:25:58 +02:00
|
|
|
error: this `match` has identical arm bodies
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:74:18
|
2018-10-30 21:36:52 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
74 | Ok(_) => println!("ok"),
|
2018-10-30 21:36:52 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 14:25:58 +02:00
|
|
|
note: same as this
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:73:18
|
2018-10-30 21:36:52 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
73 | Ok(3) => println!("ok"),
|
2018-10-30 21:36:52 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 14:25:58 +02:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:73:18
|
2018-10-30 21:36:52 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
73 | Ok(3) => println!("ok"),
|
2018-10-30 21:36:52 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 14:25:58 +02:00
|
|
|
|
2017-02-11 14:42:42 +01:00
|
|
|
error: Err(_) will match all errors, maybe not a good idea
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:81:9
|
2018-10-30 21:36:52 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
81 | Err(_) => {panic!();}
|
2018-10-30 21:36:52 +01:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
= note: to remove this warning, match each error separately or use unreachable macro
|
2017-02-11 14:42:42 +01:00
|
|
|
|
2017-09-12 14:25:58 +02:00
|
|
|
error: this `match` has identical arm bodies
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:80:18
|
2018-10-30 21:36:52 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
80 | Ok(_) => println!("ok"),
|
2018-10-30 21:36:52 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 14:25:58 +02:00
|
|
|
note: same as this
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:79:18
|
2018-10-30 21:36:52 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
79 | Ok(3) => println!("ok"),
|
2018-10-30 21:36:52 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 14:25:58 +02:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:79:18
|
2018-10-30 21:36:52 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
79 | Ok(3) => println!("ok"),
|
2018-10-30 21:36:52 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 14:25:58 +02:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:87:18
|
|
|
|
|
|
|
|
|
87 | Ok(_) => println!("ok"),
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 14:25:58 +02:00
|
|
|
note: same as this
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:86:18
|
|
|
|
|
|
|
|
|
86 | Ok(3) => println!("ok"),
|
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 14:25:58 +02:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:86:18
|
|
|
|
|
|
|
|
|
86 | Ok(3) => println!("ok"),
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 14:25:58 +02:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:94:18
|
|
|
|
|
|
|
|
|
94 | Ok(_) => println!("ok"),
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 14:25:58 +02:00
|
|
|
note: same as this
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:93:18
|
|
|
|
|
|
|
|
|
93 | Ok(3) => println!("ok"),
|
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 14:25:58 +02:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:93:18
|
|
|
|
|
|
|
|
|
93 | Ok(3) => println!("ok"),
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 14:25:58 +02:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:100:18
|
2017-09-12 14:25:58 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
100 | Ok(_) => println!("ok"),
|
2017-09-12 14:25:58 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:99:18
|
2017-09-12 14:25:58 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
99 | Ok(3) => println!("ok"),
|
2017-09-12 14:25:58 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:99:18
|
2017-09-12 14:25:58 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
99 | Ok(3) => println!("ok"),
|
2017-09-12 14:25:58 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-11-29 15:45:12 +01:00
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 14:25:58 +02:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:106:18
|
2017-09-12 14:25:58 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
106 | Ok(_) => println!("ok"),
|
2017-09-12 14:25:58 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:105:18
|
2017-09-12 14:25:58 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
105 | Ok(3) => println!("ok"),
|
2017-09-12 14:25:58 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:105:18
|
2017-09-12 14:25:58 +02:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
105 | Ok(3) => println!("ok"),
|
2017-09-12 14:25:58 +02:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-11-29 15:45:12 +01:00
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 14:25:58 +02:00
|
|
|
|
2017-11-29 21:52:49 +01:00
|
|
|
error: this `match` has identical arm bodies
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:127:29
|
2017-11-29 21:52:49 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
127 | (Ok(_), Some(x)) => println!("ok {}", x),
|
2017-11-29 21:42:37 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:126:29
|
2017-11-29 21:42:37 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
126 | (Ok(x), Some(_)) => println!("ok {}", x),
|
2017-11-29 21:42:37 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:126:29
|
2017-11-29 21:42:37 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
126 | (Ok(x), Some(_)) => println!("ok {}", x),
|
2017-11-29 21:42:37 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
|
|
|
|
2017-11-29 22:42:58 +01:00
|
|
|
error: this `match` has identical arm bodies
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:142:18
|
2017-11-29 22:42:58 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
142 | Ok(_) => println!("ok"),
|
2017-11-29 22:42:58 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:141:18
|
2017-11-29 22:42:58 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
141 | Ok(3) => println!("ok"),
|
2017-11-29 22:42:58 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:141:18
|
2017-11-29 22:42:58 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
141 | Ok(3) => println!("ok"),
|
2017-11-29 22:42:58 +01:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
|
|
|
|
2017-12-19 23:22:16 +01:00
|
|
|
error: use as_ref() instead
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:149:33
|
2017-12-19 23:22:16 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
149 | let borrowed: Option<&()> = match owned {
|
2017-12-20 10:39:48 +01:00
|
|
|
| _________________________________^
|
2018-12-04 07:17:53 +01:00
|
|
|
150 | | None => None,
|
|
|
|
151 | | Some(ref v) => Some(v),
|
|
|
|
152 | | };
|
2017-12-19 23:22:16 +01:00
|
|
|
| |_____^ help: try this: `owned.as_ref()`
|
|
|
|
|
|
2018-08-01 16:30:44 +02:00
|
|
|
= note: `-D clippy::match-as-ref` implied by `-D warnings`
|
2017-12-19 23:22:16 +01:00
|
|
|
|
2017-12-20 10:39:48 +01:00
|
|
|
error: use as_mut() instead
|
2018-12-04 07:17:53 +01:00
|
|
|
--> $DIR/matches.rs:155:39
|
2017-12-19 23:22:16 +01:00
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
155 | let borrow_mut: Option<&mut ()> = match mut_owned {
|
2017-12-20 10:39:48 +01:00
|
|
|
| _______________________________________^
|
2018-12-04 07:17:53 +01:00
|
|
|
156 | | None => None,
|
|
|
|
157 | | Some(ref mut v) => Some(v),
|
|
|
|
158 | | };
|
2017-12-20 10:39:48 +01:00
|
|
|
| |_____^ help: try this: `mut_owned.as_mut()`
|
2017-12-19 23:22:16 +01:00
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
error: aborting due to 19 previous errors
|
2018-01-16 17:06:27 +01:00
|
|
|
|