mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
615 lines
22 KiB
Text
615 lines
22 KiB
Text
error: used `unwrap()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:7:17
|
|
|
|
|
LL | let _val2 = val.unwrap();
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `unwrap()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:6:15
|
|
|
|
|
LL | let val = Some(1);
|
|
| ^^^^^^^
|
|
= note: `-D clippy::unnecessary-literal-unwrap` implied by `-D warnings`
|
|
|
|
error: used `expect()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:8:17
|
|
|
|
|
LL | let _val2 = val.expect("this never happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `expect()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:6:15
|
|
|
|
|
LL | let val = Some(1);
|
|
| ^^^^^^^
|
|
|
|
error: used `unwrap()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:12:16
|
|
|
|
|
LL | let _val = Some::<usize>([1, 2, 3].iter().sum()).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `unwrap()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:12:16
|
|
|
|
|
LL | let _val = Some::<usize>([1, 2, 3].iter().sum()).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `expect()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:13:16
|
|
|
|
|
LL | let _val = Some::<usize>([1, 2, 3].iter().sum()).expect("this never happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `expect()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:13:16
|
|
|
|
|
LL | let _val = Some::<usize>([1, 2, 3].iter().sum()).expect("this never happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:16:17
|
|
|
|
|
LL | let _val2 = val.unwrap();
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `unwrap()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:15:15
|
|
|
|
|
LL | let val = Some::<usize>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `expect()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:17:17
|
|
|
|
|
LL | let _val2 = val.expect("this never happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `expect()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:15:15
|
|
|
|
|
LL | let val = Some::<usize>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap()` on `None` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:22:17
|
|
|
|
|
LL | let _val2 = val.unwrap();
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
help: remove the `None` and `unwrap()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:21:15
|
|
|
|
|
LL | let val = None::<()>;
|
|
| ^^^^^^^^^^
|
|
|
|
error: used `expect()` on `None` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:23:17
|
|
|
|
|
LL | let _val2 = val.expect("this always happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `None` and `expect()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:21:15
|
|
|
|
|
LL | let val = None::<()>;
|
|
| ^^^^^^^^^^
|
|
|
|
error: used `unwrap_or_default()` on `None` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:24:21
|
|
|
|
|
LL | let _val3: u8 = None.unwrap_or_default();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the `None` and `unwrap_or_default()`: `Default::default()`
|
|
|
|
error: used `unwrap_or_default()` on `None` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:25:5
|
|
|
|
|
LL | None::<()>.unwrap_or_default();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the `None` and `unwrap_or_default()`: `Default::default()`
|
|
|
|
error: used `unwrap()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:30:17
|
|
|
|
|
LL | let _val2 = val.unwrap();
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:29:15
|
|
|
|
|
LL | let val = Ok::<_, ()>(1);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: used `expect()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:31:17
|
|
|
|
|
LL | let _val2 = val.expect("this never happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `expect()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:29:15
|
|
|
|
|
LL | let val = Ok::<_, ()>(1);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_err()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:32:17
|
|
|
|
|
LL | let _val2 = val.unwrap_err();
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap_err()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:29:15
|
|
|
|
|
LL | let val = Ok::<_, ()>(1);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: used `expect_err()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:33:17
|
|
|
|
|
LL | let _val2 = val.expect_err("this always happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `expect_err()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:29:15
|
|
|
|
|
LL | let val = Ok::<_, ()>(1);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:37:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:37:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `expect()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:38:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).expect("this never happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `expect()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:38:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).expect("this never happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_err()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:39:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).unwrap_err();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap_err()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:39:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).unwrap_err();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `expect_err()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:40:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).expect_err("this always happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `expect_err()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:40:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).expect_err("this always happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:43:17
|
|
|
|
|
LL | let _val2 = val.unwrap();
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:42:15
|
|
|
|
|
LL | let val = Ok::<usize, ()>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `expect()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:44:17
|
|
|
|
|
LL | let _val2 = val.expect("this never happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `expect()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:42:15
|
|
|
|
|
LL | let val = Ok::<usize, ()>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_err()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:45:17
|
|
|
|
|
LL | let _val2 = val.unwrap_err();
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap_err()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:42:15
|
|
|
|
|
LL | let val = Ok::<usize, ()>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `expect_err()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:46:17
|
|
|
|
|
LL | let _val2 = val.expect_err("this always happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `expect_err()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:42:15
|
|
|
|
|
LL | let val = Ok::<usize, ()>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_err()` on `Err` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:51:17
|
|
|
|
|
LL | let _val2 = val.unwrap_err();
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Err` and `unwrap_err()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:50:15
|
|
|
|
|
LL | let val = Err::<(), _>(1);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
error: used `expect_err()` on `Err` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:52:17
|
|
|
|
|
LL | let _val2 = val.expect_err("this never happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Err` and `expect_err()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:50:15
|
|
|
|
|
LL | let val = Err::<(), _>(1);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap()` on `Err` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:53:17
|
|
|
|
|
LL | let _val2 = val.unwrap();
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Err` and `unwrap()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:50:15
|
|
|
|
|
LL | let val = Err::<(), _>(1);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
error: used `expect()` on `Err` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:54:17
|
|
|
|
|
LL | let _val2 = val.expect("this always happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Err` and `expect()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:50:15
|
|
|
|
|
LL | let val = Err::<(), _>(1);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_err()` on `Err` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:58:16
|
|
|
|
|
LL | let _val = Err::<(), usize>([1, 2, 3].iter().sum()).unwrap_err();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Err` and `unwrap_err()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:58:16
|
|
|
|
|
LL | let _val = Err::<(), usize>([1, 2, 3].iter().sum()).unwrap_err();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `expect_err()` on `Err` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:59:16
|
|
|
|
|
LL | let _val = Err::<(), usize>([1, 2, 3].iter().sum()).expect_err("this never happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Err` and `expect_err()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:59:16
|
|
|
|
|
LL | let _val = Err::<(), usize>([1, 2, 3].iter().sum()).expect_err("this never happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap()` on `Err` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:60:16
|
|
|
|
|
LL | let _val = Err::<(), usize>([1, 2, 3].iter().sum()).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Err` and `unwrap()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:60:16
|
|
|
|
|
LL | let _val = Err::<(), usize>([1, 2, 3].iter().sum()).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `expect()` on `Err` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:61:16
|
|
|
|
|
LL | let _val = Err::<(), usize>([1, 2, 3].iter().sum()).expect("this always happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Err` and `expect()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:61:16
|
|
|
|
|
LL | let _val = Err::<(), usize>([1, 2, 3].iter().sum()).expect("this always happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_err()` on `Err` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:64:17
|
|
|
|
|
LL | let _val2 = val.unwrap_err();
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Err` and `unwrap_err()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:63:15
|
|
|
|
|
LL | let val = Err::<(), usize>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `expect_err()` on `Err` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:65:17
|
|
|
|
|
LL | let _val2 = val.expect_err("this never happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Err` and `expect_err()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:63:15
|
|
|
|
|
LL | let val = Err::<(), usize>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap()` on `Err` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:66:17
|
|
|
|
|
LL | let _val2 = val.unwrap();
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Err` and `unwrap()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:63:15
|
|
|
|
|
LL | let val = Err::<(), usize>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `expect()` on `Err` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:67:17
|
|
|
|
|
LL | let _val2 = val.expect("this always happens");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Err` and `expect()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:63:15
|
|
|
|
|
LL | let val = Err::<(), usize>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:72:17
|
|
|
|
|
LL | let _val2 = val.unwrap_or(2);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `unwrap_or()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:71:15
|
|
|
|
|
LL | let val = Some(1);
|
|
| ^^^^^^^
|
|
|
|
error: used `unwrap_or_default()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:73:17
|
|
|
|
|
LL | let _val2 = val.unwrap_or_default();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `unwrap_or_default()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:71:15
|
|
|
|
|
LL | let val = Some(1);
|
|
| ^^^^^^^
|
|
|
|
error: used `unwrap_or_else()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:74:17
|
|
|
|
|
LL | let _val2 = val.unwrap_or_else(|| 2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `unwrap_or_else()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:71:15
|
|
|
|
|
LL | let val = Some(1);
|
|
| ^^^^^^^
|
|
|
|
error: used `unwrap_or()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:78:16
|
|
|
|
|
LL | let _val = Some::<usize>([1, 2, 3].iter().sum()).unwrap_or(2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `unwrap_or()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:78:16
|
|
|
|
|
LL | let _val = Some::<usize>([1, 2, 3].iter().sum()).unwrap_or(2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or_default()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:79:16
|
|
|
|
|
LL | let _val = Some::<usize>([1, 2, 3].iter().sum()).unwrap_or_default();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `unwrap_or_default()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:79:16
|
|
|
|
|
LL | let _val = Some::<usize>([1, 2, 3].iter().sum()).unwrap_or_default();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or_else()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:80:16
|
|
|
|
|
LL | let _val = Some::<usize>([1, 2, 3].iter().sum()).unwrap_or_else(|| 2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `unwrap_or_else()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:80:16
|
|
|
|
|
LL | let _val = Some::<usize>([1, 2, 3].iter().sum()).unwrap_or_else(|| 2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:83:17
|
|
|
|
|
LL | let _val2 = val.unwrap_or(2);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `unwrap_or()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:82:15
|
|
|
|
|
LL | let val = Some::<usize>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or_default()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:84:17
|
|
|
|
|
LL | let _val2 = val.unwrap_or_default();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `unwrap_or_default()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:82:15
|
|
|
|
|
LL | let val = Some::<usize>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or_else()` on `Some` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:85:17
|
|
|
|
|
LL | let _val2 = val.unwrap_or_else(|| 2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Some` and `unwrap_or_else()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:82:15
|
|
|
|
|
LL | let val = Some::<usize>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:90:17
|
|
|
|
|
LL | let _val2 = val.unwrap_or(2);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap_or()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:89:15
|
|
|
|
|
LL | let val = Ok::<_, ()>(1);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or_default()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:91:17
|
|
|
|
|
LL | let _val2 = val.unwrap_or_default();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap_or_default()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:89:15
|
|
|
|
|
LL | let val = Ok::<_, ()>(1);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or_else()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:92:17
|
|
|
|
|
LL | let _val2 = val.unwrap_or_else(|_| 2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap_or_else()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:89:15
|
|
|
|
|
LL | let val = Ok::<_, ()>(1);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:96:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).unwrap_or(2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap_or()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:96:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).unwrap_or(2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or_default()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:97:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).unwrap_or_default();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap_or_default()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:97:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).unwrap_or_default();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or_else()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:98:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).unwrap_or_else(|_| 2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap_or_else()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:98:16
|
|
|
|
|
LL | let _val = Ok::<usize, ()>([1, 2, 3].iter().sum()).unwrap_or_else(|_| 2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:101:17
|
|
|
|
|
LL | let _val2 = val.unwrap_or(2);
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap_or()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:100:15
|
|
|
|
|
LL | let val = Ok::<usize, ()>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or_default()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:102:17
|
|
|
|
|
LL | let _val2 = val.unwrap_or_default();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap_or_default()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:100:15
|
|
|
|
|
LL | let val = Ok::<usize, ()>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: used `unwrap_or_else()` on `Ok` value
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:103:17
|
|
|
|
|
LL | let _val2 = val.unwrap_or_else(|_| 2);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `Ok` and `unwrap_or_else()`
|
|
--> $DIR/unnecessary_literal_unwrap_unfixable.rs:100:15
|
|
|
|
|
LL | let val = Ok::<usize, ()>([1, 2, 3].iter().sum());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 52 previous errors
|
|
|