rust/tests/ui/unnecessary_literal_unwrap.stderr
2023-06-12 16:19:26 +01:00

28 lines
732 B
Plaintext

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