2023-07-02 07:35:19 -05:00
|
|
|
error: used `unwrap()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:11:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Some(1).unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-literal-unwrap` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_literal_unwrap)]`
|
2023-07-02 07:35:19 -05:00
|
|
|
help: remove the `Some` and `unwrap()`
|
|
|
|
|
|
|
|
|
LL - let _val = Some(1).unwrap();
|
|
|
|
LL + let _val = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `expect()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:12:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
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: used `unwrap()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:14:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Some(1).unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Some` and `unwrap()`
|
|
|
|
|
|
|
|
|
LL - Some(1).unwrap();
|
|
|
|
LL + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `expect()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:15:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Some(1).expect("this never happens");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Some` and `expect()`
|
|
|
|
|
|
|
|
|
LL - Some(1).expect("this never happens");
|
|
|
|
LL + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:20:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = None::<()>.unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: remove the `None` and `unwrap()`: `panic!()`
|
|
|
|
|
|
|
|
error: used `expect()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:21:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = None::<()>.expect("this always happens");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `None` and `expect()`
|
|
|
|
|
|
|
|
|
LL | let _val = panic!("this always happens");
|
2024-06-21 23:32:49 -05:00
|
|
|
| ~~~~~~~
|
2023-07-02 07:35:19 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: used `unwrap_or_default()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:22:24
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | let _val: String = None.unwrap_or_default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the `None` and `unwrap_or_default()`: `String::default()`
|
|
|
|
|
|
|
|
error: used `unwrap_or()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:23:21
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | let _val: u16 = None.unwrap_or(234);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `None` and `unwrap_or()`
|
|
|
|
|
|
|
|
|
LL - let _val: u16 = None.unwrap_or(234);
|
|
|
|
LL + let _val: u16 = 234;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_else()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:24:21
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | let _val: u16 = None.unwrap_or_else(|| 234);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `None` and `unwrap_or_else()`
|
|
|
|
|
|
|
|
|
LL - let _val: u16 = None.unwrap_or_else(|| 234);
|
|
|
|
LL + let _val: u16 = 234;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_else()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:25:21
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | let _val: u16 = None.unwrap_or_else(|| { 234 });
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `None` and `unwrap_or_else()`
|
|
|
|
|
|
|
|
|
LL - let _val: u16 = None.unwrap_or_else(|| { 234 });
|
|
|
|
LL + let _val: u16 = { 234 };
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_else()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:26:21
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | let _val: u16 = None.unwrap_or_else(|| -> u16 { 234 });
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `None` and `unwrap_or_else()`
|
|
|
|
|
|
|
|
|
LL - let _val: u16 = None.unwrap_or_else(|| -> u16 { 234 });
|
2023-10-02 16:24:23 -05:00
|
|
|
LL + let _val: u16 = { 234 };
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
error: used `unwrap()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:28:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | None::<()>.unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: remove the `None` and `unwrap()`: `panic!()`
|
|
|
|
|
|
|
|
error: used `expect()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:29:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | None::<()>.expect("this always happens");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `None` and `expect()`
|
|
|
|
|
|
|
|
|
LL | panic!("this always happens");
|
2024-06-21 23:32:49 -05:00
|
|
|
| ~~~~~~~
|
2023-07-02 07:35:19 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: used `unwrap_or_default()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:30:5
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | None::<String>.unwrap_or_default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the `None` and `unwrap_or_default()`: `String::default()`
|
|
|
|
|
|
|
|
error: used `unwrap_or()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:31:5
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | None::<u16>.unwrap_or(234);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `None` and `unwrap_or()`
|
|
|
|
|
|
|
|
|
LL - None::<u16>.unwrap_or(234);
|
|
|
|
LL + 234;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_else()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:32:5
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | None::<u16>.unwrap_or_else(|| 234);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `None` and `unwrap_or_else()`
|
|
|
|
|
|
|
|
|
LL - None::<u16>.unwrap_or_else(|| 234);
|
|
|
|
LL + 234;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_else()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:33:5
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | None::<u16>.unwrap_or_else(|| { 234 });
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `None` and `unwrap_or_else()`
|
|
|
|
|
|
|
|
|
LL - None::<u16>.unwrap_or_else(|| { 234 });
|
|
|
|
LL + { 234 };
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_else()` on `None` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:34:5
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | None::<u16>.unwrap_or_else(|| -> u16 { 234 });
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `None` and `unwrap_or_else()`
|
|
|
|
|
|
|
|
|
LL - None::<u16>.unwrap_or_else(|| -> u16 { 234 });
|
2023-10-02 16:24:23 -05:00
|
|
|
LL + { 234 };
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
error: used `unwrap()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:38:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Ok::<_, ()>(1).unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap()`
|
|
|
|
|
|
|
|
|
LL - let _val = Ok::<_, ()>(1).unwrap();
|
|
|
|
LL + let _val = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `expect()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:39:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Ok::<_, ()>(1).expect("this never happens");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `expect()`
|
|
|
|
|
|
|
|
|
LL - let _val = Ok::<_, ()>(1).expect("this never happens");
|
|
|
|
LL + let _val = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_err()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:40:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Ok::<_, ()>(1).unwrap_err();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap_err()`
|
|
|
|
|
|
|
|
|
LL | let _val = panic!("{:?}", 1);
|
|
|
|
| ~~~~~~~~~~~~~~ ~
|
|
|
|
|
|
|
|
error: used `expect_err()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:41:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Ok::<_, ()>(1).expect_err("this always happens");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `expect_err()`
|
|
|
|
|
|
|
|
|
LL | let _val = panic!("{1}: {:?}", 1, "this always happens");
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~ ~
|
|
|
|
|
|
|
|
error: used `unwrap()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:43:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Ok::<_, ()>(1).unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap()`
|
|
|
|
|
|
|
|
|
LL - Ok::<_, ()>(1).unwrap();
|
|
|
|
LL + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `expect()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:44:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Ok::<_, ()>(1).expect("this never happens");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `expect()`
|
|
|
|
|
|
|
|
|
LL - Ok::<_, ()>(1).expect("this never happens");
|
|
|
|
LL + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_err()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:45:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Ok::<_, ()>(1).unwrap_err();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap_err()`
|
|
|
|
|
|
|
|
|
LL | panic!("{:?}", 1);
|
|
|
|
| ~~~~~~~~~~~~~~ ~
|
|
|
|
|
|
|
|
error: used `expect_err()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:46:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Ok::<_, ()>(1).expect_err("this always happens");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `expect_err()`
|
|
|
|
|
|
|
|
|
LL | panic!("{1}: {:?}", 1, "this always happens");
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~ ~
|
|
|
|
|
|
|
|
error: used `unwrap_err()` on `Err` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:50:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Err::<(), _>(1).unwrap_err();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Err` and `unwrap_err()`
|
|
|
|
|
|
|
|
|
LL - let _val = Err::<(), _>(1).unwrap_err();
|
|
|
|
LL + let _val = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `expect_err()` on `Err` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:51:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Err::<(), _>(1).expect_err("this never happens");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Err` and `expect_err()`
|
|
|
|
|
|
|
|
|
LL - let _val = Err::<(), _>(1).expect_err("this never happens");
|
|
|
|
LL + let _val = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap()` on `Err` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:52:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Err::<(), _>(1).unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Err` and `unwrap()`
|
|
|
|
|
|
|
|
|
LL | let _val = panic!("{:?}", 1);
|
|
|
|
| ~~~~~~~~~~~~~~ ~
|
|
|
|
|
|
|
|
error: used `expect()` on `Err` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:53:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Err::<(), _>(1).expect("this always happens");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Err` and `expect()`
|
|
|
|
|
|
|
|
|
LL | let _val = panic!("{1}: {:?}", 1, "this always happens");
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~ ~
|
|
|
|
|
|
|
|
error: used `unwrap_err()` on `Err` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:55:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Err::<(), _>(1).unwrap_err();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Err` and `unwrap_err()`
|
|
|
|
|
|
|
|
|
LL - Err::<(), _>(1).unwrap_err();
|
|
|
|
LL + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `expect_err()` on `Err` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:56:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Err::<(), _>(1).expect_err("this never happens");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Err` and `expect_err()`
|
|
|
|
|
|
|
|
|
LL - Err::<(), _>(1).expect_err("this never happens");
|
|
|
|
LL + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap()` on `Err` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:57:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Err::<(), _>(1).unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Err` and `unwrap()`
|
|
|
|
|
|
|
|
|
LL | panic!("{:?}", 1);
|
|
|
|
| ~~~~~~~~~~~~~~ ~
|
|
|
|
|
|
|
|
error: used `expect()` on `Err` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:58:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Err::<(), _>(1).expect("this always happens");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Err` and `expect()`
|
|
|
|
|
|
|
|
|
LL | panic!("{1}: {:?}", 1, "this always happens");
|
|
|
|
| ~~~~~~~~~~~~~~~~~~~ ~
|
|
|
|
|
|
|
|
error: used `unwrap_or()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:62:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Some(1).unwrap_or(2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Some` and `unwrap_or()`
|
|
|
|
|
|
|
|
|
LL - let _val = Some(1).unwrap_or(2);
|
|
|
|
LL + let _val = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_default()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:63:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Some(1).unwrap_or_default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Some` and `unwrap_or_default()`
|
|
|
|
|
|
|
|
|
LL - let _val = Some(1).unwrap_or_default();
|
|
|
|
LL + let _val = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_else()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:64:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Some(1).unwrap_or_else(|| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Some` and `unwrap_or_else()`
|
|
|
|
|
|
|
|
|
LL - let _val = Some(1).unwrap_or_else(|| 2);
|
|
|
|
LL + let _val = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:66:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Some(1).unwrap_or(2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Some` and `unwrap_or()`
|
|
|
|
|
|
|
|
|
LL - Some(1).unwrap_or(2);
|
|
|
|
LL + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_default()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:67:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Some(1).unwrap_or_default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Some` and `unwrap_or_default()`
|
|
|
|
|
|
|
|
|
LL - Some(1).unwrap_or_default();
|
|
|
|
LL + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_else()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:68:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Some(1).unwrap_or_else(|| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Some` and `unwrap_or_else()`
|
|
|
|
|
|
|
|
|
LL - Some(1).unwrap_or_else(|| 2);
|
|
|
|
LL + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:72:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Ok::<_, ()>(1).unwrap_or(2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap_or()`
|
|
|
|
|
|
|
|
|
LL - let _val = Ok::<_, ()>(1).unwrap_or(2);
|
|
|
|
LL + let _val = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_default()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:73:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Ok::<_, ()>(1).unwrap_or_default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap_or_default()`
|
|
|
|
|
|
|
|
|
LL - let _val = Ok::<_, ()>(1).unwrap_or_default();
|
|
|
|
LL + let _val = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_else()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:74:16
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _val = Ok::<_, ()>(1).unwrap_or_else(|_| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap_or_else()`
|
|
|
|
|
|
|
|
|
LL - let _val = Ok::<_, ()>(1).unwrap_or_else(|_| 2);
|
|
|
|
LL + let _val = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:76:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Ok::<_, ()>(1).unwrap_or(2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap_or()`
|
|
|
|
|
|
|
|
|
LL - Ok::<_, ()>(1).unwrap_or(2);
|
|
|
|
LL + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_default()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:77:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Ok::<_, ()>(1).unwrap_or_default();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap_or_default()`
|
|
|
|
|
|
|
|
|
LL - Ok::<_, ()>(1).unwrap_or_default();
|
|
|
|
LL + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_or_else()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:78:5
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | Ok::<_, ()>(1).unwrap_or_else(|_| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap_or_else()`
|
|
|
|
|
|
|
|
|
LL - Ok::<_, ()>(1).unwrap_or_else(|_| 2);
|
|
|
|
LL + 1;
|
|
|
|
|
|
|
|
|
|
2023-07-17 03:19:29 -05:00
|
|
|
error: used `unwrap_unchecked()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:92:22
|
2023-07-17 03:19:29 -05:00
|
|
|
|
|
|
|
|
LL | let _ = unsafe { Some(1).unwrap_unchecked() };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Some` and `unwrap_unchecked()`
|
|
|
|
|
|
|
|
|
LL - let _ = unsafe { Some(1).unwrap_unchecked() };
|
|
|
|
LL + let _ = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_unchecked()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:93:22
|
2023-07-17 03:19:29 -05:00
|
|
|
|
|
|
|
|
LL | let _ = unsafe { Some(1).unwrap_unchecked() + *(&1 as *const i32) }; // needs to keep the unsafe block
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Some` and `unwrap_unchecked()`
|
|
|
|
|
|
|
|
|
LL - let _ = unsafe { Some(1).unwrap_unchecked() + *(&1 as *const i32) }; // needs to keep the unsafe block
|
|
|
|
LL + let _ = unsafe { 1 + *(&1 as *const i32) }; // needs to keep the unsafe block
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_unchecked()` on `Some` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:94:22
|
2023-07-17 03:19:29 -05:00
|
|
|
|
|
|
|
|
LL | let _ = unsafe { Some(1).unwrap_unchecked() } + 1;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Some` and `unwrap_unchecked()`
|
|
|
|
|
|
|
|
|
LL - let _ = unsafe { Some(1).unwrap_unchecked() } + 1;
|
|
|
|
LL + let _ = 1 + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_unchecked()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:95:22
|
2023-07-17 03:19:29 -05:00
|
|
|
|
|
|
|
|
LL | let _ = unsafe { Ok::<_, ()>(1).unwrap_unchecked() };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap_unchecked()`
|
|
|
|
|
|
|
|
|
LL - let _ = unsafe { Ok::<_, ()>(1).unwrap_unchecked() };
|
|
|
|
LL + let _ = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_unchecked()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:96:22
|
2023-07-17 03:19:29 -05:00
|
|
|
|
|
|
|
|
LL | let _ = unsafe { Ok::<_, ()>(1).unwrap_unchecked() + *(&1 as *const i32) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap_unchecked()`
|
|
|
|
|
|
|
|
|
LL - let _ = unsafe { Ok::<_, ()>(1).unwrap_unchecked() + *(&1 as *const i32) };
|
|
|
|
LL + let _ = unsafe { 1 + *(&1 as *const i32) };
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_unchecked()` on `Ok` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:97:22
|
2023-07-17 03:19:29 -05:00
|
|
|
|
|
|
|
|
LL | let _ = unsafe { Ok::<_, ()>(1).unwrap_unchecked() } + 1;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Ok` and `unwrap_unchecked()`
|
|
|
|
|
|
|
|
|
LL - let _ = unsafe { Ok::<_, ()>(1).unwrap_unchecked() } + 1;
|
|
|
|
LL + let _ = 1 + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
error: used `unwrap_err_unchecked()` on `Err` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/unnecessary_literal_unwrap.rs:98:22
|
2023-07-17 03:19:29 -05:00
|
|
|
|
|
|
|
|
LL | let _ = unsafe { Err::<(), i32>(123).unwrap_err_unchecked() };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `Err` and `unwrap_err_unchecked()`
|
|
|
|
|
|
|
|
|
LL - let _ = unsafe { Err::<(), i32>(123).unwrap_err_unchecked() };
|
|
|
|
LL + let _ = 123;
|
|
|
|
|
|
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: aborting due to 53 previous errors
|
2023-07-02 07:35:19 -05:00
|
|
|
|