2020-06-09 09:36:01 -05:00
|
|
|
error: use of `unwrap_or` followed by a function call
|
|
|
|
--> $DIR/or_fun_call.rs:32:19
|
|
|
|
|
|
|
|
|
LL | with_const_fn.unwrap_or(Duration::from_secs(5));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| Duration::from_secs(5))`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::or-fun-call` implied by `-D warnings`
|
|
|
|
|
2019-04-11 00:47:04 -05:00
|
|
|
error: use of `unwrap_or` followed by a function call
|
2019-08-22 00:41:00 -05:00
|
|
|
--> $DIR/or_fun_call.rs:35:22
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_constructor.unwrap_or(make());
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(make)`
|
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a call to `new`
|
2019-08-22 00:41:00 -05:00
|
|
|
--> $DIR/or_fun_call.rs:38:5
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_new.unwrap_or(Vec::new());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_new.unwrap_or_default()`
|
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a function call
|
2019-08-22 00:41:00 -05:00
|
|
|
--> $DIR/or_fun_call.rs:41:21
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_const_args.unwrap_or(Vec::with_capacity(12));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| Vec::with_capacity(12))`
|
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a function call
|
2019-08-22 00:41:00 -05:00
|
|
|
--> $DIR/or_fun_call.rs:44:14
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_err.unwrap_or(make());
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| make())`
|
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a function call
|
2019-08-22 00:41:00 -05:00
|
|
|
--> $DIR/or_fun_call.rs:47:19
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_err_args.unwrap_or(Vec::with_capacity(12));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| Vec::with_capacity(12))`
|
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a call to `default`
|
2019-08-22 00:41:00 -05:00
|
|
|
--> $DIR/or_fun_call.rs:50:5
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_default_trait.unwrap_or(Default::default());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_trait.unwrap_or_default()`
|
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a call to `default`
|
2019-08-22 00:41:00 -05:00
|
|
|
--> $DIR/or_fun_call.rs:53:5
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_default_type.unwrap_or(u64::default());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_type.unwrap_or_default()`
|
|
|
|
|
2020-04-01 13:14:05 -05:00
|
|
|
error: use of `unwrap_or` followed by a call to `new`
|
|
|
|
--> $DIR/or_fun_call.rs:56:5
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | with_vec.unwrap_or(vec![]);
|
2020-04-01 13:14:05 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_vec.unwrap_or_default()`
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
error: use of `unwrap_or` followed by a function call
|
2020-04-01 13:14:05 -05:00
|
|
|
--> $DIR/or_fun_call.rs:59:21
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | without_default.unwrap_or(Foo::new());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(Foo::new)`
|
|
|
|
|
2020-10-09 05:45:29 -05:00
|
|
|
error: use of `or_insert` followed by a function call
|
|
|
|
--> $DIR/or_fun_call.rs:62:19
|
|
|
|
|
|
|
|
|
LL | map.entry(42).or_insert(String::new());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
|
|
|
|
|
|
|
|
error: use of `or_insert` followed by a function call
|
|
|
|
--> $DIR/or_fun_call.rs:65:21
|
|
|
|
|
|
|
|
|
LL | btree.entry(42).or_insert(String::new());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
|
|
|
|
|
2019-04-11 00:47:04 -05:00
|
|
|
error: use of `unwrap_or` followed by a function call
|
2020-10-09 05:45:29 -05:00
|
|
|
--> $DIR/or_fun_call.rs:68:21
|
2019-04-11 00:47:04 -05:00
|
|
|
|
|
|
|
|
LL | let _ = stringy.unwrap_or("".to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())`
|
|
|
|
|
2019-05-12 03:18:38 -05:00
|
|
|
error: use of `or` followed by a function call
|
2020-10-09 05:45:29 -05:00
|
|
|
--> $DIR/or_fun_call.rs:93:35
|
2019-05-12 03:18:38 -05:00
|
|
|
|
|
|
|
|
LL | let _ = Some("a".to_string()).or(Some("b".to_string()));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some("b".to_string()))`
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
error: use of `or` followed by a function call
|
2020-10-09 05:45:29 -05:00
|
|
|
--> $DIR/or_fun_call.rs:97:10
|
2020-06-09 09:36:01 -05:00
|
|
|
|
|
|
|
|
LL | .or(Some(Bar(b, Duration::from_secs(2))));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some(Bar(b, Duration::from_secs(2))))`
|
|
|
|
|
2020-10-09 05:45:29 -05:00
|
|
|
error: aborting due to 15 previous errors
|
2019-04-11 00:47:04 -05:00
|
|
|
|