2019-04-11 00:47:04 -05:00
|
|
|
error: use of `unwrap_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:52:22
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_constructor.unwrap_or(make());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(make)`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::or-fun-call` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::or_fun_call)]`
|
2019-04-11 00:47:04 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: use of `unwrap_or` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:55:14
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_new.unwrap_or(Vec::new());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::unwrap-or-default` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unwrap_or_default)]`
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:58:21
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_const_args.unwrap_or(Vec::with_capacity(12));
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| Vec::with_capacity(12))`
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:61:14
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_err.unwrap_or(make());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| make())`
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:64:19
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_err_args.unwrap_or(Vec::with_capacity(12));
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| Vec::with_capacity(12))`
|
2019-04-11 00:47:04 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: use of `unwrap_or` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:67:24
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_default_trait.unwrap_or(Default::default());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
2019-04-11 00:47:04 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: use of `unwrap_or` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:70:23
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_default_type.unwrap_or(u64::default());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
2019-04-11 00:47:04 -05:00
|
|
|
|
2021-08-12 04:16:25 -05:00
|
|
|
error: use of `unwrap_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:73:18
|
2021-08-12 04:16:25 -05:00
|
|
|
|
|
|
|
|
LL | self_default.unwrap_or(<FakeDefault>::default());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(<FakeDefault>::default)`
|
2021-08-12 04:16:25 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: use of `unwrap_or` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:76:18
|
2021-08-12 04:16:25 -05:00
|
|
|
|
|
|
|
|
LL | real_default.unwrap_or(<FakeDefault as Default>::default());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
2021-08-12 04:16:25 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: use of `unwrap_or` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:79:14
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_vec.unwrap_or(vec![]);
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:82:21
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | without_default.unwrap_or(Foo::new());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(Foo::new)`
|
2019-04-11 00:47:04 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: use of `or_insert` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:85:19
|
2022-09-09 06:36:26 -05:00
|
|
|
|
|
|
|
|
LL | map.entry(42).or_insert(String::new());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
2022-09-09 06:36:26 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: use of `or_insert` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:88:23
|
2022-09-09 06:36:26 -05:00
|
|
|
|
|
|
|
|
LL | map_vec.entry(42).or_insert(vec![]);
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
2022-09-09 06:36:26 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: use of `or_insert` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:91:21
|
2022-09-09 06:36:26 -05:00
|
|
|
|
|
|
|
|
LL | btree.entry(42).or_insert(String::new());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
2022-09-09 06:36:26 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: use of `or_insert` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:94:25
|
2022-09-09 06:36:26 -05:00
|
|
|
|
|
|
|
|
LL | btree_vec.entry(42).or_insert(vec![]);
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
2022-09-09 06:36:26 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: use of `unwrap_or` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:97:21
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
2022-08-31 08:24:45 -05:00
|
|
|
LL | let _ = stringy.unwrap_or(String::new());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
2019-04-11 00:47:04 -05:00
|
|
|
|
2020-11-23 06:51:04 -06:00
|
|
|
error: use of `unwrap_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:105:21
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
|
LL | let _ = Some(1).unwrap_or(map[&1]);
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| map[&1])`
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:107:21
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
|
LL | let _ = Some(1).unwrap_or(map[&1]);
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| map[&1])`
|
2020-11-23 06:51:04 -06:00
|
|
|
|
2019-05-12 03:18:38 -05:00
|
|
|
error: use of `or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:131:35
|
2019-05-12 03:18:38 -05:00
|
|
|
|
|
|
|
|
LL | let _ = Some("a".to_string()).or(Some("b".to_string()));
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_else(|| Some("b".to_string()))`
|
2019-05-12 03:18:38 -05:00
|
|
|
|
2021-03-25 13:29:11 -05:00
|
|
|
error: use of `unwrap_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:170:14
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
LL | None.unwrap_or(ptr_to_ref(s));
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| ptr_to_ref(s))`
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:176:14
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
LL | None.unwrap_or(unsafe { ptr_to_ref(s) });
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:178:14
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
LL | None.unwrap_or( unsafe { ptr_to_ref(s) } );
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
|
2021-03-25 13:29:11 -05:00
|
|
|
|
2022-11-21 13:34:47 -06:00
|
|
|
error: use of `map_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:253:25
|
2022-11-21 13:34:47 -06:00
|
|
|
|
|
|
|
|
LL | let _ = Some(4).map_or(g(), |v| v);
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(g, |v| v)`
|
2022-11-21 13:34:47 -06:00
|
|
|
|
|
|
|
error: use of `map_or` followed by a function call
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:254:25
|
2022-11-21 13:34:47 -06:00
|
|
|
|
|
|
|
|
LL | let _ = Some(4).map_or(g(), f);
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^ help: try: `map_or_else(g, f)`
|
2022-11-21 13:34:47 -06:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: use of `unwrap_or_else` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:285:18
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | with_new.unwrap_or_else(Vec::new);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
|
|
|
|
|
|
|
error: use of `unwrap_or_else` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:288:28
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | with_default_trait.unwrap_or_else(Default::default);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
|
|
|
|
|
|
|
error: use of `unwrap_or_else` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:291:27
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | with_default_type.unwrap_or_else(u64::default);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
|
|
|
|
|
|
|
error: use of `unwrap_or_else` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:294:22
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | real_default.unwrap_or_else(<FakeDefault as Default>::default);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
|
|
|
|
|
|
|
error: use of `or_insert_with` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:297:23
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | map.entry(42).or_insert_with(String::new);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
|
|
|
|
|
|
|
error: use of `or_insert_with` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:300:25
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | btree.entry(42).or_insert_with(String::new);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
|
|
|
|
|
|
|
error: use of `unwrap_or_else` to construct default value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/or_fun_call.rs:303:25
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | let _ = stringy.unwrap_or_else(String::new);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
|
|
|
|
|
|
|
error: aborting due to 31 previous errors
|
2019-04-11 00:47:04 -05:00
|
|
|
|