File tree Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ fn or_fun_call() {
62
62
map.entry(42).or_insert_with(String::new);
63
63
64
64
let mut btree = BTreeMap::<u64, String>::new();
65
- btree.entry(42).or_insert_with (String::new);
65
+ btree.entry(42).or_insert (String::new() );
66
66
67
67
let stringy = Some(String::from(""));
68
68
let _ = stringy.unwrap_or_else(|| "".to_owned());
Original file line number Diff line number Diff line change @@ -66,12 +66,6 @@ error: use of `or_insert` followed by a function call
66
66
LL | map.entry(42).or_insert(String::new());
67
67
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
68
68
69
- error: use of `or_insert` followed by a function call
70
- --> $DIR/or_fun_call.rs:65:21
71
- |
72
- LL | btree.entry(42).or_insert(String::new());
73
- | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
74
-
75
69
error: use of `unwrap_or` followed by a function call
76
70
--> $DIR/or_fun_call.rs:68:21
77
71
|
@@ -90,5 +84,5 @@ error: use of `or` followed by a function call
90
84
LL | .or(Some(Bar(b, Duration::from_secs(2))));
91
85
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some(Bar(b, Duration::from_secs(2))))`
92
86
93
- error: aborting due to 15 previous errors
87
+ error: aborting due to 14 previous errors
94
88
You can’t perform that action at this time.
0 commit comments