Skip to content

Commit 478d444

Browse files
committed
Allow manual_unwrap_or_default at useless_conversion_try tests
1 parent 5b63ab1 commit 478d444

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

tests/ui/useless_conversion_try.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#![deny(clippy::useless_conversion)]
2-
#![allow(clippy::needless_if, clippy::unnecessary_fallible_conversions)]
2+
#![allow(
3+
clippy::needless_if,
4+
clippy::unnecessary_fallible_conversions,
5+
clippy::manual_unwrap_or_default
6+
)]
37

48
fn test_generic<T: Copy>(val: T) -> T {
59
let _ = T::try_from(val).unwrap();

tests/ui/useless_conversion_try.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: useless conversion to the same type: `T`
2-
--> tests/ui/useless_conversion_try.rs:5:13
2+
--> tests/ui/useless_conversion_try.rs:9:13
33
|
44
LL | let _ = T::try_from(val).unwrap();
55
| ^^^^^^^^^^^^^^^^
@@ -12,63 +12,63 @@ LL | #![deny(clippy::useless_conversion)]
1212
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
1313

1414
error: useless conversion to the same type: `T`
15-
--> tests/ui/useless_conversion_try.rs:7:5
15+
--> tests/ui/useless_conversion_try.rs:11:5
1616
|
1717
LL | val.try_into().unwrap()
1818
| ^^^^^^^^^^^^^^
1919
|
2020
= help: consider removing `.try_into()`
2121

2222
error: useless conversion to the same type: `std::string::String`
23-
--> tests/ui/useless_conversion_try.rs:30:21
23+
--> tests/ui/useless_conversion_try.rs:34:21
2424
|
2525
LL | let _: String = "foo".to_string().try_into().unwrap();
2626
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2727
|
2828
= help: consider removing `.try_into()`
2929

3030
error: useless conversion to the same type: `std::string::String`
31-
--> tests/ui/useless_conversion_try.rs:32:21
31+
--> tests/ui/useless_conversion_try.rs:36:21
3232
|
3333
LL | let _: String = TryFrom::try_from("foo".to_string()).unwrap();
3434
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3535
|
3636
= help: consider removing `TryFrom::try_from()`
3737

3838
error: useless conversion to the same type: `std::string::String`
39-
--> tests/ui/useless_conversion_try.rs:34:13
39+
--> tests/ui/useless_conversion_try.rs:38:13
4040
|
4141
LL | let _ = String::try_from("foo".to_string()).unwrap();
4242
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4343
|
4444
= help: consider removing `String::try_from()`
4545

4646
error: useless conversion to the same type: `std::string::String`
47-
--> tests/ui/useless_conversion_try.rs:36:13
47+
--> tests/ui/useless_conversion_try.rs:40:13
4848
|
4949
LL | let _ = String::try_from(format!("A: {:04}", 123)).unwrap();
5050
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5151
|
5252
= help: consider removing `String::try_from()`
5353

5454
error: useless conversion to the same type: `std::string::String`
55-
--> tests/ui/useless_conversion_try.rs:38:21
55+
--> tests/ui/useless_conversion_try.rs:42:21
5656
|
5757
LL | let _: String = format!("Hello {}", "world").try_into().unwrap();
5858
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5959
|
6060
= help: consider removing `.try_into()`
6161

6262
error: useless conversion to the same type: `std::string::String`
63-
--> tests/ui/useless_conversion_try.rs:40:21
63+
--> tests/ui/useless_conversion_try.rs:44:21
6464
|
6565
LL | let _: String = String::new().try_into().unwrap();
6666
| ^^^^^^^^^^^^^^^^^^^^^^^^
6767
|
6868
= help: consider removing `.try_into()`
6969

7070
error: useless conversion to the same type: `std::string::String`
71-
--> tests/ui/useless_conversion_try.rs:42:27
71+
--> tests/ui/useless_conversion_try.rs:46:27
7272
|
7373
LL | let _: String = match String::from("_").try_into() {
7474
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)