@@ -42,38 +42,38 @@ error: use of `unwrap_or` followed by a call to `default`
42
42
LL | with_default_type.unwrap_or(u64::default());
43
43
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_type.unwrap_or_default()`
44
44
45
- error: use of `unwrap_or` followed by a function call
46
- --> $DIR/or_fun_call.rs:56:14
45
+ error: use of `unwrap_or` followed by a call to `new`
46
+ --> $DIR/or_fun_call.rs:56:5
47
47
|
48
48
LL | with_vec.unwrap_or(vec![]);
49
- | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| vec![] )`
49
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_vec.unwrap_or_default( )`
50
50
51
51
error: use of `unwrap_or` followed by a function call
52
- --> $DIR/or_fun_call.rs:61 :21
52
+ --> $DIR/or_fun_call.rs:59 :21
53
53
|
54
54
LL | without_default.unwrap_or(Foo::new());
55
55
| ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(Foo::new)`
56
56
57
57
error: use of `or_insert` followed by a function call
58
- --> $DIR/or_fun_call.rs:64 :19
58
+ --> $DIR/or_fun_call.rs:62 :19
59
59
|
60
60
LL | map.entry(42).or_insert(String::new());
61
61
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
62
62
63
63
error: use of `or_insert` followed by a function call
64
- --> $DIR/or_fun_call.rs:67 :21
64
+ --> $DIR/or_fun_call.rs:65 :21
65
65
|
66
66
LL | btree.entry(42).or_insert(String::new());
67
67
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
68
68
69
69
error: use of `unwrap_or` followed by a function call
70
- --> $DIR/or_fun_call.rs:70 :21
70
+ --> $DIR/or_fun_call.rs:68 :21
71
71
|
72
72
LL | let _ = stringy.unwrap_or("".to_owned());
73
73
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())`
74
74
75
75
error: use of `or` followed by a function call
76
- --> $DIR/or_fun_call.rs:95 :35
76
+ --> $DIR/or_fun_call.rs:93 :35
77
77
|
78
78
LL | let _ = Some("a".to_string()).or(Some("b".to_string()));
79
79
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some("b".to_string()))`
0 commit comments