test: remove unwrap.rs

The file is testing `unwrap_used`, but that's already covered by the
`unwrap_expect_used.rs` test file
This commit is contained in:
Ada Alakbarova 2026-01-22 00:17:38 +01:00
parent f2b567fa14
commit 76a536c590
No known key found for this signature in database
2 changed files with 0 additions and 53 deletions

View file

@ -1,22 +0,0 @@
#![warn(clippy::unwrap_used)]
#![allow(clippy::unnecessary_literal_unwrap)]
fn unwrap_option() {
let opt = Some(0);
let _ = opt.unwrap();
//~^ unwrap_used
}
fn unwrap_result() {
let res: Result<u8, u8> = Ok(0);
let _ = res.unwrap();
//~^ unwrap_used
let _ = res.unwrap_err();
//~^ unwrap_used
}
fn main() {
unwrap_option();
unwrap_result();
}

View file

@ -1,31 +0,0 @@
error: used `unwrap()` on an `Option` value
--> tests/ui/unwrap.rs:6:13
|
LL | let _ = opt.unwrap();
| ^^^^^^^^^^^^
|
= note: if this value is `None`, it will panic
= help: consider using `expect()` to provide a better panic message
= note: `-D clippy::unwrap-used` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unwrap_used)]`
error: used `unwrap()` on a `Result` value
--> tests/ui/unwrap.rs:12:13
|
LL | let _ = res.unwrap();
| ^^^^^^^^^^^^
|
= note: if this value is an `Err`, it will panic
= help: consider using `expect()` to provide a better panic message
error: used `unwrap_err()` on a `Result` value
--> tests/ui/unwrap.rs:15:13
|
LL | let _ = res.unwrap_err();
| ^^^^^^^^^^^^^^^^
|
= note: if this value is an `Ok`, it will panic
= help: consider using `expect_err()` to provide a better panic message
error: aborting due to 3 previous errors