Skip to content

Commit c3b3cb3

Browse files
Fix missing ui tests annotations
1 parent 49179d6 commit c3b3cb3

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

tests/ui/bind_instead_of_map.fixed

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ pub fn main() {
66
let x = Some(5);
77
// the easiest cases
88
let _ = x;
9+
//~^ bind_instead_of_map
910
let _ = x.map(|o| o + 1);
11+
//~^ bind_instead_of_map
1012
// and an easy counter-example
1113
let _ = x.and_then(|o| if o < 32 { Some(o) } else { None });
1214

1315
// Different type
1416
let x: Result<u32, &str> = Ok(1);
1517
let _ = x;
18+
//~^ bind_instead_of_map
1619
}
1720

1821
pub fn foo() -> Option<String> {

tests/ui/bind_instead_of_map.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ pub fn main() {
66
let x = Some(5);
77
// the easiest cases
88
let _ = x.and_then(Some);
9+
//~^ bind_instead_of_map
910
let _ = x.and_then(|o| Some(o + 1));
11+
//~^ bind_instead_of_map
1012
// and an easy counter-example
1113
let _ = x.and_then(|o| if o < 32 { Some(o) } else { None });
1214

1315
// Different type
1416
let x: Result<u32, &str> = Ok(1);
1517
let _ = x.and_then(Ok);
18+
//~^ bind_instead_of_map
1619
}
1720

1821
pub fn foo() -> Option<String> {

tests/ui/bind_instead_of_map.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ LL | #![deny(clippy::bind_instead_of_map)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212

1313
error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
14-
--> tests/ui/bind_instead_of_map.rs:9:13
14+
--> tests/ui/bind_instead_of_map.rs:10:13
1515
|
1616
LL | let _ = x.and_then(|o| Some(o + 1));
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.map(|o| o + 1)`
1818

1919
error: using `Result.and_then(Ok)`, which is a no-op
20-
--> tests/ui/bind_instead_of_map.rs:15:13
20+
--> tests/ui/bind_instead_of_map.rs:17:13
2121
|
2222
LL | let _ = x.and_then(Ok);
2323
| ^^^^^^^^^^^^^^ help: use the expression directly: `x`

0 commit comments

Comments
 (0)