rust/tests/ui/manual_ok_err.stderr
2025-01-28 19:33:54 +01:00

95 lines
2.3 KiB
Text

error: manual implementation of `ok`
--> tests/ui/manual_ok_err.rs:8:13
|
LL | let _ = match funcall() {
| _____________^
LL | |
LL | | Ok(v) => Some(v),
LL | | Err(_) => None,
LL | | };
| |_____^ help: replace with: `funcall().ok()`
|
= note: `-D clippy::manual-ok-err` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::manual_ok_err)]`
error: manual implementation of `ok`
--> tests/ui/manual_ok_err.rs:14:13
|
LL | let _ = match funcall() {
| _____________^
LL | |
LL | | Ok(v) => Some(v),
LL | | _v => None,
LL | | };
| |_____^ help: replace with: `funcall().ok()`
error: manual implementation of `err`
--> tests/ui/manual_ok_err.rs:20:13
|
LL | let _ = match funcall() {
| _____________^
LL | |
LL | | Err(v) => Some(v),
LL | | Ok(_) => None,
LL | | };
| |_____^ help: replace with: `funcall().err()`
error: manual implementation of `err`
--> tests/ui/manual_ok_err.rs:26:13
|
LL | let _ = match funcall() {
| _____________^
LL | |
LL | | Err(v) => Some(v),
LL | | _v => None,
LL | | };
| |_____^ help: replace with: `funcall().err()`
error: manual implementation of `ok`
--> tests/ui/manual_ok_err.rs:32:13
|
LL | let _ = if let Ok(v) = funcall() {
| _____________^
LL | |
LL | | Some(v)
LL | | } else {
LL | | None
LL | | };
| |_____^ help: replace with: `funcall().ok()`
error: manual implementation of `err`
--> tests/ui/manual_ok_err.rs:39:13
|
LL | let _ = if let Err(v) = funcall() {
| _____________^
LL | |
LL | | Some(v)
LL | | } else {
LL | | None
LL | | };
| |_____^ help: replace with: `funcall().err()`
error: manual implementation of `ok`
--> tests/ui/manual_ok_err.rs:47:13
|
LL | let _ = match funcall() {
| _____________^
LL | |
LL | | Ok(v) => Some(v),
LL | | _v @ _ => None,
LL | | };
| |_____^ help: replace with: `funcall().ok()`
error: manual implementation of `ok`
--> tests/ui/manual_ok_err.rs:64:13
|
LL | let _ = match -S {
| _____________^
LL | |
LL | | Ok(v) => Some(v),
LL | | _ => None,
LL | | };
| |_____^ help: replace with: `(-S).ok()`
error: aborting due to 8 previous errors