2020-08-28 14:10:16 +00:00
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:36:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = opt.unwrap_or_else(|| 2);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^--------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(2)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-lazy-evaluations` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:37:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = opt.unwrap_or_else(|| astronomers_pi);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^---------------------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(astronomers_pi)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:38:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = opt.unwrap_or_else(|| ext_str.some_field);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^-------------------------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(ext_str.some_field)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:40:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = opt.and_then(|_| ext_opt);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: use `and(..)` instead: `and(ext_opt)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:41:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = opt.or_else(|| ext_opt);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^-------------------
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(ext_opt)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:42:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = opt.or_else(|| None);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^----------------
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(None)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:43:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = opt.get_or_insert_with(|| 2);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^------------------------
|
|
|
|
| |
|
|
|
|
| help: use `get_or_insert(..)` instead: `get_or_insert(2)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:44:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = opt.ok_or_else(|| 2);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^----------------
|
|
|
|
| |
|
|
|
|
| help: use `ok_or(..)` instead: `ok_or(2)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:45:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
LL | let _ = nested_tuple_opt.unwrap_or_else(|| Some((1, 2)));
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^-------------------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(Some((1, 2)))`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
2022-07-18 07:39:37 +00:00
|
|
|
error: unnecessary closure used with `bool::then`
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:46:13
|
|
|
|
|
|
|
|
|
LL | let _ = cond.then(|| astronomers_pi);
|
|
|
|
| ^^^^^-----------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(astronomers_pi)`
|
|
|
|
|
2020-08-28 14:10:16 +00:00
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:49:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = Some(10).unwrap_or_else(|| 2);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^^^^^--------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(2)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:50:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = Some(10).and_then(|_| ext_opt);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: use `and(..)` instead: `and(ext_opt)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:51:28
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _: Option<usize> = None.or_else(|| ext_opt);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^-------------------
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(ext_opt)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:52:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = None.get_or_insert_with(|| 2);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^------------------------
|
|
|
|
| |
|
|
|
|
| help: use `get_or_insert(..)` instead: `get_or_insert(2)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:53:35
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _: Result<usize, usize> = None.ok_or_else(|| 2);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^----------------
|
|
|
|
| |
|
|
|
|
| help: use `ok_or(..)` instead: `ok_or(2)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:54:28
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _: Option<usize> = None.or_else(|| None);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^----------------
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(None)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:57:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = deep.0.unwrap_or_else(|| 2);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^^^--------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(2)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:58:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = deep.0.and_then(|_| ext_opt);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: use `and(..)` instead: `and(ext_opt)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:59:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = deep.0.or_else(|| None);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^^^----------------
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(None)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:60:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = deep.0.get_or_insert_with(|| 2);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^^^------------------------
|
|
|
|
| |
|
|
|
|
| help: use `get_or_insert(..)` instead: `get_or_insert(2)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:61:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = deep.0.ok_or_else(|| 2);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^^^----------------
|
|
|
|
| |
|
|
|
|
| help: use `ok_or(..)` instead: `ok_or(2)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:81:28
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
|
LL | let _: Option<usize> = None.or_else(|| Some(3));
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^-------------------
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(Some(3))`
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:82:13
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
|
LL | let _ = deep.0.or_else(|| Some(3));
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^^^-------------------
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(Some(3))`
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:83:13
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
|
LL | let _ = opt.or_else(|| Some(3));
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^-------------------
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(Some(3))`
|
2020-09-24 12:49:22 +00:00
|
|
|
|
2020-08-28 14:10:16 +00:00
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:89:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = res2.unwrap_or_else(|_| 2);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(2)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:90:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = res2.unwrap_or_else(|_| astronomers_pi);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^----------------------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(astronomers_pi)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:91:13
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
|
LL | let _ = res2.unwrap_or_else(|_| ext_str.some_field);
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^^--------------------------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(ext_str.some_field)`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:113:35
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
|
LL | let _: Result<usize, usize> = res.and_then(|_| Err(2));
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^--------------------
|
|
|
|
| |
|
|
|
|
| help: use `and(..)` instead: `and(Err(2))`
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:114:35
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
|
LL | let _: Result<usize, usize> = res.and_then(|_| Err(astronomers_pi));
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^---------------------------------
|
|
|
|
| |
|
|
|
|
| help: use `and(..)` instead: `and(Err(astronomers_pi))`
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:115:35
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
|
LL | let _: Result<usize, usize> = res.and_then(|_| Err(ext_str.some_field));
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^-------------------------------------
|
|
|
|
| |
|
|
|
|
| help: use `and(..)` instead: `and(Err(ext_str.some_field))`
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:117:35
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
|
LL | let _: Result<usize, usize> = res.or_else(|_| Ok(2));
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^------------------
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(Ok(2))`
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:118:35
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
|
LL | let _: Result<usize, usize> = res.or_else(|_| Ok(astronomers_pi));
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^-------------------------------
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(Ok(astronomers_pi))`
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:119:35
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
|
LL | let _: Result<usize, usize> = res.or_else(|_| Ok(ext_str.some_field));
|
2022-03-24 13:50:04 +00:00
|
|
|
| ^^^^-----------------------------------
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(Ok(ext_str.some_field))`
|
2020-09-24 12:49:22 +00:00
|
|
|
|
2022-03-24 13:50:04 +00:00
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2022-07-18 07:39:37 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:120:35
|
2022-03-24 13:50:04 +00:00
|
|
|
|
|
|
|
|
LL | let _: Result<usize, usize> = res.
|
|
|
|
| ___________________________________^
|
|
|
|
LL | | // some lines
|
|
|
|
LL | | // some lines
|
|
|
|
LL | | // some lines
|
|
|
|
... |
|
|
|
|
LL | | // some lines
|
|
|
|
LL | | or_else(|_| Ok(ext_str.some_field));
|
|
|
|
| |_________----------------------------------^
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(Ok(ext_str.some_field))`
|
|
|
|
|
2022-07-18 07:39:37 +00:00
|
|
|
error: aborting due to 34 previous errors
|
2020-08-28 14:10:16 +00:00
|
|
|
|