error: you don't need to add `&` to all patterns
- --> $DIR/matches.rs:26:9
+ --> $DIR/matches.rs:20:9
|
-26 | / match v {
-27 | | &Some(v) => println!("{:?}", v),
-28 | | &None => println!("none"),
-29 | | }
+LL | / match v {
+LL | | &Some(v) => println!("{:?}", v),
+LL | | &None => println!("none"),
+LL | | }
| |_________^
|
= note: `-D clippy::match-ref-pats` implied by `-D warnings`
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
-26 | match *v {
-27 | Some(v) => println!("{:?}", v),
-28 | None => println!("none"),
+LL | match *v {
+LL | Some(v) => println!("{:?}", v),
+LL | None => println!("none"),
|
error: you don't need to add `&` to all patterns
- --> $DIR/matches.rs:36:5
+ --> $DIR/matches.rs:31:5
|
-36 | / match tup {
-37 | | &(v, 1) => println!("{}", v),
-38 | | _ => println!("none"),
-39 | | }
+LL | / match tup {
+LL | | &(v, 1) => println!("{}", v),
+LL | | _ => println!("none"),
+LL | | }
| |_____^
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
-36 | match *tup {
-37 | (v, 1) => println!("{}", v),
+LL | match *tup {
+LL | (v, 1) => println!("{}", v),
|
error: you don't need to add `&` to both the expression and the patterns
- --> $DIR/matches.rs:42:5
+ --> $DIR/matches.rs:37:5
|
-42 | / match &w {
-43 | | &Some(v) => println!("{:?}", v),
-44 | | &None => println!("none"),
-45 | | }
+LL | / match &w {
+LL | | &Some(v) => println!("{:?}", v),
+LL | | &None => println!("none"),
+LL | | }
| |_____^
help: try
|
-42 | match w {
-43 | Some(v) => println!("{:?}", v),
-44 | None => println!("none"),
+LL | match w {
+LL | Some(v) => println!("{:?}", v),
+LL | None => println!("none"),
|
error: you don't need to add `&` to all patterns
- --> $DIR/matches.rs:53:5
+ --> $DIR/matches.rs:48:5
|
-53 | / if let &None = a {
-54 | | println!("none");
-55 | | }
+LL | / if let &None = a {
+LL | | println!("none");
+LL | | }
| |_____^
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
-53 | if let None = *a {
+LL | if let None = *a {
| ^^^^ ^^
error: you don't need to add `&` to both the expression and the patterns
- --> $DIR/matches.rs:58:5
+ --> $DIR/matches.rs:53:5
|
-58 | / if let &None = &b {
-59 | | println!("none");
-60 | | }
+LL | / if let &None = &b {
+LL | | println!("none");
+LL | | }
| |_____^
help: try
|
-58 | if let None = b {
+LL | if let None = b {
| ^^^^ ^
error: Err(_) will match all errors, maybe not a good idea
- --> $DIR/matches.rs:69:9
+ --> $DIR/matches.rs:64:9
|
-69 | Err(_) => panic!("err")
+LL | Err(_) => panic!("err"),
| ^^^^^^
|
= note: `-D clippy::match-wild-err-arm` implied by `-D warnings`
= note: to remove this warning, match each error separately or use unreachable macro
error: this `match` has identical arm bodies
- --> $DIR/matches.rs:68:18
+ --> $DIR/matches.rs:63:18
|
-68 | Ok(_) => println!("ok"),
+LL | Ok(_) => println!("ok"),
| ^^^^^^^^^^^^^^
|
= note: `-D clippy::match-same-arms` implied by `-D warnings`
note: same as this
- --> $DIR/matches.rs:67:18
+ --> $DIR/matches.rs:62:18
|
-67 | Ok(3) => println!("ok"),
+LL | Ok(3) => println!("ok"),
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
- --> $DIR/matches.rs:67:18
+ --> $DIR/matches.rs:62:18
|
-67 | Ok(3) => println!("ok"),
+LL | 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)
error: Err(_) will match all errors, maybe not a good idea
- --> $DIR/matches.rs:75:9
+ --> $DIR/matches.rs:70:9
|
-75 | Err(_) => {panic!()}
+LL | Err(_) => panic!(),
| ^^^^^^
|
= note: to remove this warning, match each error separately or use unreachable macro
error: this `match` has identical arm bodies
- --> $DIR/matches.rs:74:18
+ --> $DIR/matches.rs:69:18
|
-74 | Ok(_) => println!("ok"),
+LL | Ok(_) => println!("ok"),
| ^^^^^^^^^^^^^^
|
note: same as this
- --> $DIR/matches.rs:73:18
+ --> $DIR/matches.rs:68:18
|
-73 | Ok(3) => println!("ok"),
+LL | Ok(3) => println!("ok"),
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
- --> $DIR/matches.rs:73:18
+ --> $DIR/matches.rs:68:18
|
-73 | Ok(3) => println!("ok"),
+LL | 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)
error: Err(_) will match all errors, maybe not a good idea
- --> $DIR/matches.rs:81:9
+ --> $DIR/matches.rs:76:9
|
-81 | Err(_) => {panic!();}
+LL | Err(_) => {
| ^^^^^^
|
= note: to remove this warning, match each error separately or use unreachable macro
error: this `match` has identical arm bodies
- --> $DIR/matches.rs:80:18
+ --> $DIR/matches.rs:75:18
|
-80 | Ok(_) => println!("ok"),
+LL | Ok(_) => println!("ok"),
| ^^^^^^^^^^^^^^
|
note: same as this
- --> $DIR/matches.rs:79:18
+ --> $DIR/matches.rs:74:18
|
-79 | Ok(3) => println!("ok"),
+LL | Ok(3) => println!("ok"),
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
- --> $DIR/matches.rs:79:18
+ --> $DIR/matches.rs:74:18
|
-79 | Ok(3) => println!("ok"),
+LL | 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)
error: this `match` has identical arm bodies
- --> $DIR/matches.rs:87:18
+ --> $DIR/matches.rs:84:18
|
-87 | Ok(_) => println!("ok"),
+LL | Ok(_) => println!("ok"),
| ^^^^^^^^^^^^^^
|
note: same as this
- --> $DIR/matches.rs:86:18
+ --> $DIR/matches.rs:83:18
|
-86 | Ok(3) => println!("ok"),
+LL | Ok(3) => println!("ok"),
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
- --> $DIR/matches.rs:86:18
+ --> $DIR/matches.rs:83:18
|
-86 | Ok(3) => println!("ok"),
+LL | 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)
error: this `match` has identical arm bodies
- --> $DIR/matches.rs:94:18
+ --> $DIR/matches.rs:91:18
|
-94 | Ok(_) => println!("ok"),
+LL | Ok(_) => println!("ok"),
| ^^^^^^^^^^^^^^
|
note: same as this
- --> $DIR/matches.rs:93:18
+ --> $DIR/matches.rs:90:18
|
-93 | Ok(3) => println!("ok"),
+LL | Ok(3) => println!("ok"),
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
- --> $DIR/matches.rs:93:18
+ --> $DIR/matches.rs:90:18
|
-93 | Ok(3) => println!("ok"),
+LL | 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)
error: this `match` has identical arm bodies
- --> $DIR/matches.rs:100:18
- |
-100 | Ok(_) => println!("ok"),
- | ^^^^^^^^^^^^^^
- |
+ --> $DIR/matches.rs:97:18
+ |
+LL | Ok(_) => println!("ok"),
+ | ^^^^^^^^^^^^^^
+ |
note: same as this
- --> $DIR/matches.rs:99:18
- |
-99 | Ok(3) => println!("ok"),
- | ^^^^^^^^^^^^^^
+ --> $DIR/matches.rs:96:18
+ |
+LL | Ok(3) => println!("ok"),
+ | ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
- --> $DIR/matches.rs:99:18
- |
-99 | 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)
+ --> $DIR/matches.rs:96:18
+ |
+LL | 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)
error: this `match` has identical arm bodies
- --> $DIR/matches.rs:106:18
- |
-106 | Ok(_) => println!("ok"),
- | ^^^^^^^^^^^^^^
- |
+ --> $DIR/matches.rs:103:18
+ |
+LL | Ok(_) => println!("ok"),
+ | ^^^^^^^^^^^^^^
+ |
note: same as this
- --> $DIR/matches.rs:105:18
- |
-105 | Ok(3) => println!("ok"),
- | ^^^^^^^^^^^^^^
+ --> $DIR/matches.rs:102:18
+ |
+LL | Ok(3) => println!("ok"),
+ | ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
- --> $DIR/matches.rs:105:18
- |
-105 | 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)
+ --> $DIR/matches.rs:102:18
+ |
+LL | 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)
error: this `match` has identical arm bodies
- --> $DIR/matches.rs:127:29
- |
-127 | (Ok(_), Some(x)) => println!("ok {}", x),
- | ^^^^^^^^^^^^^^^^^^^^
- |
+ --> $DIR/matches.rs:126:29
+ |
+LL | (Ok(_), Some(x)) => println!("ok {}", x),
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
note: same as this
- --> $DIR/matches.rs:126:29
- |
-126 | (Ok(x), Some(_)) => println!("ok {}", x),
- | ^^^^^^^^^^^^^^^^^^^^
+ --> $DIR/matches.rs:125:29
+ |
+LL | (Ok(x), Some(_)) => println!("ok {}", x),
+ | ^^^^^^^^^^^^^^^^^^^^
note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
- --> $DIR/matches.rs:126:29
- |
-126 | (Ok(x), Some(_)) => println!("ok {}", x),
- | ^^^^^^^^^^^^^^^^^^^^
- = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+ --> $DIR/matches.rs:125:29
+ |
+LL | (Ok(x), Some(_)) => println!("ok {}", x),
+ | ^^^^^^^^^^^^^^^^^^^^
+ = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: this `match` has identical arm bodies
- --> $DIR/matches.rs:142:18
- |
-142 | Ok(_) => println!("ok"),
- | ^^^^^^^^^^^^^^
- |
+ --> $DIR/matches.rs:141:18
+ |
+LL | Ok(_) => println!("ok"),
+ | ^^^^^^^^^^^^^^
+ |
note: same as this
- --> $DIR/matches.rs:141:18
- |
-141 | Ok(3) => println!("ok"),
- | ^^^^^^^^^^^^^^
+ --> $DIR/matches.rs:140:18
+ |
+LL | Ok(3) => println!("ok"),
+ | ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
- --> $DIR/matches.rs:141:18
- |
-141 | 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)
+ --> $DIR/matches.rs:140:18
+ |
+LL | 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)
error: use as_ref() instead
- --> $DIR/matches.rs:149:33
- |
-149 | let borrowed: Option<&()> = match owned {
- | _________________________________^
-150 | | None => None,
-151 | | Some(ref v) => Some(v),
-152 | | };
- | |_____^ help: try this: `owned.as_ref()`
- |
- = note: `-D clippy::match-as-ref` implied by `-D warnings`
+ --> $DIR/matches.rs:150:33
+ |
+LL | let borrowed: Option<&()> = match owned {
+ | _________________________________^
+LL | | None => None,
+LL | | Some(ref v) => Some(v),
+LL | | };
+ | |_____^ help: try this: `owned.as_ref()`
+ |
+ = note: `-D clippy::match-as-ref` implied by `-D warnings`
error: use as_mut() instead
- --> $DIR/matches.rs:155:39
- |
-155 | let borrow_mut: Option<&mut ()> = match mut_owned {
- | _______________________________________^
-156 | | None => None,
-157 | | Some(ref mut v) => Some(v),
-158 | | };
- | |_____^ help: try this: `mut_owned.as_mut()`
+ --> $DIR/matches.rs:156:39
+ |
+LL | let borrow_mut: Option<&mut ()> = match mut_owned {
+ | _______________________________________^
+LL | | None => None,
+LL | | Some(ref mut v) => Some(v),
+LL | | };
+ | |_____^ help: try this: `mut_owned.as_mut()`
error: aborting due to 19 previous errors