Skip to content

Commit 351d782

Browse files
committed
Fix clippy test
1 parent 3a7fd6c commit 351d782

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/tools/clippy/tests/ui/single_match_else.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn main() {
9090

9191
// lint here
9292
use std::convert::Infallible;
93-
if let Ok(a) = Result::<i32, Infallible>::Ok(1) { println!("${:?}", a) } else {
93+
if let Ok(a) = Result::<i32, &Infallible>::Ok(1) { println!("${:?}", a) } else {
9494
println!("else block");
9595
return;
9696
}

src/tools/clippy/tests/ui/single_match_else.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn main() {
9999

100100
// lint here
101101
use std::convert::Infallible;
102-
match Result::<i32, Infallible>::Ok(1) {
102+
match Result::<i32, &Infallible>::Ok(1) {
103103
Ok(a) => println!("${:?}", a),
104104
Err(_) => {
105105
println!("else block");

src/tools/clippy/tests/ui/single_match_else.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ LL + }
6464
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
6565
--> tests/ui/single_match_else.rs:102:5
6666
|
67-
LL | / match Result::<i32, Infallible>::Ok(1) {
67+
LL | / match Result::<i32, &Infallible>::Ok(1) {
6868
LL | | Ok(a) => println!("${:?}", a),
6969
LL | | Err(_) => {
7070
LL | | println!("else block");
@@ -75,7 +75,7 @@ LL | | }
7575
|
7676
help: try
7777
|
78-
LL ~ if let Ok(a) = Result::<i32, Infallible>::Ok(1) { println!("${:?}", a) } else {
78+
LL ~ if let Ok(a) = Result::<i32, &Infallible>::Ok(1) { println!("${:?}", a) } else {
7979
LL + println!("else block");
8080
LL + return;
8181
LL + }

0 commit comments

Comments
 (0)