rust-clippy/tests/ui/unnecessary_literal_unwrap.stderr

28 lines
732 B
Text
Raw Normal View History

2023-02-16 13:36:51 +00:00
error: used `unwrap()` on `Some` value
2023-02-16 14:21:43 +00:00
--> $DIR/unnecessary_literal_unwrap.rs:5:15
2023-02-16 13:36:51 +00:00
|
LL | let val = Some(1).unwrap();
| ^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unnecessary-literal-unwrap` implied by `-D warnings`
2023-02-16 14:21:43 +00:00
help: remove the `Some` and `unwrap()`
|
LL - let val = Some(1).unwrap();
LL + let val = 1;
|
2023-02-16 13:36:51 +00:00
2023-02-16 13:44:11 +00:00
error: used `expect()` on `Some` value
2023-02-16 14:21:43 +00:00
--> $DIR/unnecessary_literal_unwrap.rs:6:15
2023-02-16 13:44:11 +00:00
|
LL | let val = Some(1).expect("this never happens");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2023-02-16 14:21:43 +00:00
help: remove the `Some` and `expect()`
|
LL - let val = Some(1).expect("this never happens");
LL + let val = 1;
|
2023-02-16 13:44:11 +00:00
error: aborting due to 2 previous errors
2023-02-16 13:36:51 +00:00