Files
rust/tests/ui/manual_ok_err.stderr

116 lines
2.7 KiB
Plaintext
Raw Normal View History

2024-11-27 18:28:23 +01:00
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`
2025-02-12 23:44:38 +01:00
--> tests/ui/manual_ok_err.rs:14:13
2024-11-27 18:28:23 +01:00
|
LL | let _ = match funcall() {
| _____________^
LL | |
LL | | Ok(v) => Some(v),
LL | | _v => None,
LL | | };
| |_____^ help: replace with: `funcall().ok()`
error: manual implementation of `err`
2025-02-12 23:44:38 +01:00
--> tests/ui/manual_ok_err.rs:20:13
2024-11-27 18:28:23 +01:00
|
LL | let _ = match funcall() {
| _____________^
LL | |
LL | | Err(v) => Some(v),
LL | | Ok(_) => None,
LL | | };
| |_____^ help: replace with: `funcall().err()`
error: manual implementation of `err`
2025-02-12 23:44:38 +01:00
--> tests/ui/manual_ok_err.rs:26:13
2024-11-27 18:28:23 +01:00
|
LL | let _ = match funcall() {
| _____________^
LL | |
LL | | Err(v) => Some(v),
LL | | _v => None,
LL | | };
| |_____^ help: replace with: `funcall().err()`
error: manual implementation of `ok`
2025-02-12 23:44:38 +01:00
--> tests/ui/manual_ok_err.rs:32:13
2024-11-27 18:28:23 +01:00
|
LL | let _ = if let Ok(v) = funcall() {
| _____________^
LL | |
2025-02-11 17:57:08 +01:00
LL | |
2024-11-27 18:28:23 +01:00
LL | | Some(v)
LL | | } else {
LL | | None
LL | | };
| |_____^ help: replace with: `funcall().ok()`
error: manual implementation of `err`
2025-02-12 23:44:38 +01:00
--> tests/ui/manual_ok_err.rs:40:13
2024-11-27 18:28:23 +01:00
|
LL | let _ = if let Err(v) = funcall() {
| _____________^
LL | |
2025-02-11 17:57:08 +01:00
LL | |
2024-11-27 18:28:23 +01:00
LL | | Some(v)
LL | | } else {
LL | | None
LL | | };
| |_____^ help: replace with: `funcall().err()`
error: manual implementation of `ok`
2025-02-12 23:44:38 +01:00
--> tests/ui/manual_ok_err.rs:49:13
2024-11-27 18:28:23 +01:00
|
LL | let _ = match funcall() {
| _____________^
LL | |
LL | | Ok(v) => Some(v),
LL | | _v @ _ => None,
LL | | };
| |_____^ help: replace with: `funcall().ok()`
error: manual implementation of `ok`
2025-02-12 23:44:38 +01:00
--> tests/ui/manual_ok_err.rs:66:13
2024-11-27 18:28:23 +01:00
|
LL | let _ = match -S {
| _____________^
LL | |
LL | | Ok(v) => Some(v),
LL | | _ => None,
LL | | };
| |_____^ help: replace with: `(-S).ok()`
error: manual implementation of `ok`
--> tests/ui/manual_ok_err.rs:132:12
|
LL | } else if let Ok(n) = "1".parse::<u8>() {
| ____________^
LL | | Some(n)
LL | | } else {
LL | | None
LL | | };
| |_____^
|
help: replace with
|
LL ~ } else {
LL + "1".parse::<u8>().ok()
LL ~ };
|
error: aborting due to 9 previous errors
2024-11-27 18:28:23 +01:00