2020-08-28 14:10:16 +00:00
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:71: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`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_lazy_evaluations)]`
|
2020-08-28 14:10:16 +00:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:72: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:73: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:75: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:76: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:77: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:78: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:79: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:80: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:81:13
|
2022-07-18 07:39:37 +00:00
|
|
|
|
|
|
|
|
LL | let _ = cond.then(|| astronomers_pi);
|
|
|
|
| ^^^^^-----------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(astronomers_pi)`
|
|
|
|
|
2023-10-15 22:29:28 +00:00
|
|
|
error: unnecessary closure used with `bool::then`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:82:13
|
2023-10-15 22:29:28 +00:00
|
|
|
|
|
|
|
|
LL | let _ = true.then(|| -> _ {});
|
|
|
|
| ^^^^^----------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some({})`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:83:13
|
2023-10-15 22:29:28 +00:00
|
|
|
|
|
|
|
|
LL | let _ = true.then(|| {});
|
|
|
|
| ^^^^^-----------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some({})`
|
|
|
|
|
2020-08-28 14:10:16 +00:00
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:87:13
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | let _ = Some(1).unwrap_or_else(|| *r);
|
|
|
|
| ^^^^^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(*r)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:89:13
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | let _ = Some(1).unwrap_or_else(|| *b);
|
|
|
|
| ^^^^^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(*b)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:91:13
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | let _ = Some(1).as_ref().unwrap_or_else(|| &r);
|
|
|
|
| ^^^^^^^^^^^^^^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(&r)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:92:13
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | let _ = Some(1).as_ref().unwrap_or_else(|| &b);
|
|
|
|
| ^^^^^^^^^^^^^^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(&b)`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Option::None`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:95: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:96: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:97: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:98: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:99: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:100: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:103: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:104: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:105: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:106: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:107: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:137: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:138: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:139: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:145: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:146: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:147: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:169: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:170: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:171: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:173: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:174: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:175: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`
|
2023-06-21 22:56:15 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:176:35
|
2022-03-24 13:50:04 +00:00
|
|
|
|
|
|
|
|
LL | let _: Result<usize, usize> = res.
|
|
|
|
| ___________________________________^
|
2022-12-01 17:29:38 +00:00
|
|
|
LL | | // some lines
|
|
|
|
LL | | // some lines
|
|
|
|
LL | | // some lines
|
2022-03-24 13:50:04 +00:00
|
|
|
... |
|
2022-12-01 17:29:38 +00:00
|
|
|
LL | | // some lines
|
|
|
|
LL | | or_else(|_| Ok(ext_str.some_field));
|
|
|
|
| |_____----------------------------------^
|
|
|
|
| |
|
|
|
|
| help: use `or(..)` instead: `or(Ok(ext_str.some_field))`
|
2022-03-24 13:50:04 +00:00
|
|
|
|
2023-06-21 22:56:15 +00:00
|
|
|
error: unnecessary closure used with `bool::then`
|
2023-11-14 20:40:38 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:210:14
|
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| i32::MAX + 1);
|
|
|
|
| ^^^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(i32::MAX + 1)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:212:14
|
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| i32::MAX * 2);
|
|
|
|
| ^^^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(i32::MAX * 2)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:214:14
|
2023-06-21 22:56:15 +00:00
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| i32::MAX - 1);
|
|
|
|
| ^^^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(i32::MAX - 1)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
2023-11-14 20:40:38 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:216:14
|
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| i32::MIN - 1);
|
|
|
|
| ^^^^^^---------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(i32::MIN - 1)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:218:14
|
2023-06-21 22:56:15 +00:00
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| (1 + 2 * 3 - 2 / 3 + 9) << 2);
|
|
|
|
| ^^^^^^-------------------------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some((1 + 2 * 3 - 2 / 3 + 9) << 2)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
2023-11-14 20:40:38 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:220:14
|
2023-06-21 22:56:15 +00:00
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| 255u8 << 7);
|
|
|
|
| ^^^^^^-------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(255u8 << 7)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
2023-11-14 20:40:38 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:222:14
|
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| 255u8 << 8);
|
|
|
|
| ^^^^^^-------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(255u8 << 8)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:224:14
|
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| 255u8 >> 8);
|
|
|
|
| ^^^^^^-------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(255u8 >> 8)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:227:14
|
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| i32::MIN / -1);
|
|
|
|
| ^^^^^^----------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(i32::MIN / -1)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:229:14
|
2023-06-21 22:56:15 +00:00
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| i32::MAX + -1);
|
|
|
|
| ^^^^^^----------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(i32::MAX + -1)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
2023-11-14 20:40:38 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:231:14
|
2023-06-21 22:56:15 +00:00
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| -i32::MAX);
|
|
|
|
| ^^^^^^------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(-i32::MAX)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
2023-11-14 20:40:38 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:233:14
|
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| -i32::MIN);
|
|
|
|
| ^^^^^^------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(-i32::MIN)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:236:14
|
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| 255 >> -7);
|
|
|
|
| ^^^^^^------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(255 >> -7)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:238:14
|
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| 255 << -1);
|
|
|
|
| ^^^^^^------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(255 << -1)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:240:14
|
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| 1 / 0);
|
|
|
|
| ^^^^^^--------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(1 / 0)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:242:14
|
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| x << -1);
|
|
|
|
| ^^^^^^----------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(x << -1)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:244:14
|
2023-06-21 22:56:15 +00:00
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| x << 2);
|
|
|
|
| ^^^^^^---------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(x << 2)`
|
|
|
|
|
|
|
|
error: unnecessary closure used with `bool::then`
|
2023-11-14 20:40:38 +00:00
|
|
|
--> $DIR/unnecessary_lazy_eval.rs:258:14
|
2023-06-21 22:56:15 +00:00
|
|
|
|
|
|
|
|
LL | let _x = false.then(|| f1 + f2);
|
|
|
|
| ^^^^^^----------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some(f1 + f2)`
|
|
|
|
|
2023-11-14 20:40:38 +00:00
|
|
|
error: aborting due to 58 previous errors
|
2020-08-28 14:10:16 +00:00
|
|
|
|