2020-06-15 04:21:56 -05:00
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:34:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = opt.unwrap_or_else(|| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `unwrap_or` instead: `opt.unwrap_or(2)`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-lazy-evaluation` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:35:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = opt.unwrap_or_else(|| astronomers_pi);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `unwrap_or` instead: `opt.unwrap_or(astronomers_pi)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:36:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = opt.unwrap_or_else(|| ext_str.some_field);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `unwrap_or` instead: `opt.unwrap_or(ext_str.some_field)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:37:13
|
2020-06-15 08:26:02 -05:00
|
|
|
|
|
|
|
|
LL | let _ = opt.unwrap_or_else(|| ext_arr[0]);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `unwrap_or` instead: `opt.unwrap_or(ext_arr[0])`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:38:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = opt.and_then(|_| ext_opt);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `and` instead: `opt.and(ext_opt)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:39:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = opt.or_else(|| ext_opt);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: Use `or` instead: `opt.or(ext_opt)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:40:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = opt.or_else(|| None);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: Use `or` instead: `opt.or(None)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:41:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = opt.get_or_insert_with(|| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `get_or_insert` instead: `opt.get_or_insert(2)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:42:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = opt.ok_or_else(|| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: Use `ok_or` instead: `opt.ok_or(2)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:43:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
2020-06-15 08:26:02 -05:00
|
|
|
LL | let _ = opt.ok_or_else(|| ext_arr[0]);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `ok_or` instead: `opt.ok_or(ext_arr[0])`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:46:13
|
2020-06-15 08:26:02 -05:00
|
|
|
|
|
2020-06-15 04:21:56 -05:00
|
|
|
LL | let _ = Some(10).unwrap_or_else(|| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `unwrap_or` instead: `Some(10).unwrap_or(2)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:47:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = Some(10).and_then(|_| ext_opt);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `and` instead: `Some(10).and(ext_opt)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:48:28
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
2020-06-15 08:26:02 -05:00
|
|
|
LL | let _: Option<usize> = None.or_else(|| ext_opt);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `or` instead: `None.or(ext_opt)`
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:49:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = None.get_or_insert_with(|| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `get_or_insert` instead: `None.get_or_insert(2)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:50:35
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
2020-06-15 08:26:02 -05:00
|
|
|
LL | let _: Result<usize, usize> = None.ok_or_else(|| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: Use `ok_or` instead: `None.ok_or(2)`
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:51:28
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
2020-06-15 08:26:02 -05:00
|
|
|
LL | let _: Option<usize> = None.or_else(|| None);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: Use `or` instead: `None.or(None)`
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:54:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = deep.0.unwrap_or_else(|| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `unwrap_or` instead: `deep.0.unwrap_or(2)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:55:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = deep.0.and_then(|_| ext_opt);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `and` instead: `deep.0.and(ext_opt)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:56:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = deep.0.or_else(|| None);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: Use `or` instead: `deep.0.or(None)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:57:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = deep.0.get_or_insert_with(|| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `get_or_insert` instead: `deep.0.get_or_insert(2)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:58:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = deep.0.ok_or_else(|| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: Use `ok_or` instead: `deep.0.ok_or(2)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:84:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = res2.unwrap_or_else(|_| 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `unwrap_or` instead: `res2.unwrap_or(2)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:85:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = res2.unwrap_or_else(|_| astronomers_pi);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `unwrap_or` instead: `res2.unwrap_or(astronomers_pi)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2020-06-15 13:01:18 -05:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:86:13
|
2020-06-15 04:21:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = res2.unwrap_or_else(|_| ext_str.some_field);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Use `unwrap_or` instead: `res2.unwrap_or(ext_str.some_field)`
|
|
|
|
|
|
|
|
error: unknown clippy lint: clippy::unnecessary_lazy_eval
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:2:9
|
|
|
|
|
|
|
|
|
LL | #![warn(clippy::unnecessary_lazy_eval)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::unnecessary_lazy_evaluation`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::unknown-clippy-lints` implied by `-D warnings`
|
|
|
|
|
2020-06-15 08:26:02 -05:00
|
|
|
error: aborting due to 25 previous errors
|
2020-06-15 04:21:56 -05:00
|
|
|
|