2017-02-07 14:05:30 -06:00
|
|
|
error: you don't need to add `&` to all patterns
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:20:9
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
20 | / match v {
|
|
|
|
21 | | &Some(v) => println!("{:?}", v),
|
|
|
|
22 | | &None => println!("none"),
|
|
|
|
23 | | }
|
2018-04-05 14:18:38 -05:00
|
|
|
| |_________^
|
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
= note: `-D clippy::match-ref-pats` implied by `-D warnings`
|
2017-02-07 14:05:30 -06:00
|
|
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
20 | match *v {
|
|
|
|
21 | Some(v) => println!("{:?}", v),
|
|
|
|
22 | None => println!("none"),
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: you don't need to add `&` to all patterns
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:31:5
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
31 | / match tup {
|
|
|
|
32 | | &(v, 1) => println!("{}", v),
|
|
|
|
33 | | _ => println!("none"),
|
|
|
|
34 | | }
|
2018-04-05 14:18:38 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
31 | match *tup {
|
|
|
|
32 | (v, 1) => println!("{}", v),
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: you don't need to add `&` to both the expression and the patterns
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:37:5
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
37 | / match &w {
|
|
|
|
38 | | &Some(v) => println!("{:?}", v),
|
|
|
|
39 | | &None => println!("none"),
|
|
|
|
40 | | }
|
2018-04-05 14:18:38 -05:00
|
|
|
| |_____^
|
2018-02-04 06:41:54 -06:00
|
|
|
help: try
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
37 | match w {
|
|
|
|
38 | Some(v) => println!("{:?}", v),
|
|
|
|
39 | None => println!("none"),
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: you don't need to add `&` to all patterns
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:48:5
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
48 | / if let &None = a {
|
|
|
|
49 | | println!("none");
|
|
|
|
50 | | }
|
2018-04-07 03:23:27 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
48 | if let None = *a {
|
2018-05-29 03:56:58 -05:00
|
|
|
| ^^^^ ^^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: you don't need to add `&` to both the expression and the patterns
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:53:5
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
53 | / if let &None = &b {
|
|
|
|
54 | | println!("none");
|
|
|
|
55 | | }
|
2018-04-07 03:23:27 -05:00
|
|
|
| |_____^
|
2018-02-04 06:41:54 -06:00
|
|
|
help: try
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
53 | if let None = b {
|
2018-05-29 03:56:58 -05:00
|
|
|
| ^^^^ ^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2018-10-30 15:36:52 -05:00
|
|
|
error: Err(_) will match all errors, maybe not a good idea
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:64:9
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
64 | Err(_) => panic!("err"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-10-30 15:36:52 -05: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 14:05:30 -06:00
|
|
|
|
2018-10-30 15:36:52 -05:00
|
|
|
error: this `match` has identical arm bodies
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:63:18
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
63 | Ok(_) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-10-30 15:36:52 -05:00
|
|
|
= note: `-D clippy::match-same-arms` implied by `-D warnings`
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:62:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
62 | Ok(3) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:62:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
62 | Ok(3) => println!("ok"),
|
2018-10-30 15:36:52 -05: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 07:25:58 -05:00
|
|
|
|
2017-02-11 00:57:50 -06:00
|
|
|
error: Err(_) will match all errors, maybe not a good idea
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:70:9
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
70 | Err(_) => panic!(),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
= note: to remove this warning, match each error separately or use unreachable macro
|
2017-02-11 00:57:50 -06:00
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
error: this `match` has identical arm bodies
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:69:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
69 | Ok(_) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:68:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
68 | Ok(3) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:68:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
68 | Ok(3) => println!("ok"),
|
2018-10-30 15:36:52 -05: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 07:25:58 -05:00
|
|
|
|
2017-02-11 07:42:42 -06:00
|
|
|
error: Err(_) will match all errors, maybe not a good idea
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:76:9
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
76 | Err(_) => {
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
= note: to remove this warning, match each error separately or use unreachable macro
|
2017-02-11 07:42:42 -06:00
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
error: this `match` has identical arm bodies
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:75:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
75 | Ok(_) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:74:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
74 | Ok(3) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:74:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
74 | Ok(3) => println!("ok"),
|
2018-10-30 15:36:52 -05: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 07:25:58 -05:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:84:18
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
84 | Ok(_) => println!("ok"),
|
2018-12-04 00:17:53 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:83:18
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
83 | Ok(3) => println!("ok"),
|
2018-12-04 00:17:53 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:83:18
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
83 | Ok(3) => println!("ok"),
|
2018-12-04 00:17:53 -06: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 07:25:58 -05:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:91:18
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
91 | Ok(_) => println!("ok"),
|
2018-12-04 00:17:53 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:90:18
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
90 | Ok(3) => println!("ok"),
|
2018-12-04 00:17:53 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:90:18
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
90 | Ok(3) => println!("ok"),
|
2018-12-04 00:17:53 -06: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 07:25:58 -05:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:97:18
|
|
|
|
|
|
|
|
|
97 | Ok(_) => println!("ok"),
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:96:18
|
|
|
|
|
|
|
|
|
96 | Ok(3) => println!("ok"),
|
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:96:18
|
|
|
|
|
|
|
|
|
96 | 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 07:25:58 -05:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:103:18
|
2017-09-12 07:25:58 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
103 | Ok(_) => println!("ok"),
|
2017-09-12 07:25:58 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:102:18
|
2017-09-12 07:25:58 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
102 | Ok(3) => println!("ok"),
|
2017-09-12 07:25:58 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:102:18
|
2017-09-12 07:25:58 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
102 | Ok(3) => println!("ok"),
|
2017-09-12 07:25:58 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-11-29 08:45:12 -06: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 07:25:58 -05:00
|
|
|
|
2017-11-29 14:52:49 -06:00
|
|
|
error: this `match` has identical arm bodies
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:126:29
|
2017-11-29 14:52:49 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
126 | (Ok(_), Some(x)) => println!("ok {}", x),
|
2017-11-29 14:42:37 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:125:29
|
2017-11-29 14:42:37 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
125 | (Ok(x), Some(_)) => println!("ok {}", x),
|
2017-11-29 14:42:37 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:125:29
|
2017-11-29 14:42:37 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
125 | (Ok(x), Some(_)) => println!("ok {}", x),
|
2017-11-29 14:42:37 -06: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 15:42:58 -06:00
|
|
|
error: this `match` has identical arm bodies
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:141:18
|
2017-11-29 15:42:58 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
141 | Ok(_) => println!("ok"),
|
2017-11-29 15:42:58 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:140:18
|
2017-11-29 15:42:58 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
140 | Ok(3) => println!("ok"),
|
2017-11-29 15:42:58 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:140:18
|
2017-11-29 15:42:58 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
140 | Ok(3) => println!("ok"),
|
2017-11-29 15:42:58 -06: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 16:22:16 -06:00
|
|
|
error: use as_ref() instead
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:150:33
|
2017-12-19 16:22:16 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
150 | let borrowed: Option<&()> = match owned {
|
2017-12-20 03:39:48 -06:00
|
|
|
| _________________________________^
|
2018-12-09 23:27:19 -06:00
|
|
|
151 | | None => None,
|
|
|
|
152 | | Some(ref v) => Some(v),
|
|
|
|
153 | | };
|
2017-12-19 16:22:16 -06:00
|
|
|
| |_____^ help: try this: `owned.as_ref()`
|
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
= note: `-D clippy::match-as-ref` implied by `-D warnings`
|
2017-12-19 16:22:16 -06:00
|
|
|
|
2017-12-20 03:39:48 -06:00
|
|
|
error: use as_mut() instead
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/matches.rs:156:39
|
2017-12-19 16:22:16 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
156 | let borrow_mut: Option<&mut ()> = match mut_owned {
|
2017-12-20 03:39:48 -06:00
|
|
|
| _______________________________________^
|
2018-12-09 23:27:19 -06:00
|
|
|
157 | | None => None,
|
|
|
|
158 | | Some(ref mut v) => Some(v),
|
|
|
|
159 | | };
|
2017-12-20 03:39:48 -06:00
|
|
|
| |_____^ help: try this: `mut_owned.as_mut()`
|
2017-12-19 16:22:16 -06:00
|
|
|
|
2018-12-04 00:17:53 -06:00
|
|
|
error: aborting due to 19 previous errors
|
2018-01-16 10:06:27 -06:00
|
|
|
|