|
1 | 1 | error: replacing an `Option` with `None`
|
2 |
| - --> $DIR/mem_replace.rs:14:13 |
| 2 | + --> $DIR/mem_replace.rs:15:13 |
3 | 3 | |
|
4 | 4 | LL | let _ = mem::replace(&mut an_option, None);
|
5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `an_option.take()`
|
6 | 6 | |
|
7 | 7 | = note: `-D clippy::mem-replace-option-with-none` implied by `-D warnings`
|
8 | 8 |
|
9 | 9 | error: replacing an `Option` with `None`
|
10 |
| - --> $DIR/mem_replace.rs:16:13 |
| 10 | + --> $DIR/mem_replace.rs:17:13 |
11 | 11 | |
|
12 | 12 | LL | let _ = mem::replace(an_option, None);
|
13 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `an_option.take()`
|
14 | 14 |
|
15 | 15 | error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
|
16 |
| - --> $DIR/mem_replace.rs:21:13 |
| 16 | + --> $DIR/mem_replace.rs:22:13 |
17 | 17 | |
|
18 | 18 | LL | let _ = std::mem::replace(&mut s, String::default());
|
19 | 19 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut s)`
|
20 | 20 | |
|
21 | 21 | = note: `-D clippy::mem-replace-with-default` implied by `-D warnings`
|
22 | 22 |
|
23 | 23 | error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
|
24 |
| - --> $DIR/mem_replace.rs:23:13 |
| 24 | + --> $DIR/mem_replace.rs:25:13 |
25 | 25 | |
|
26 | 26 | LL | let _ = std::mem::replace(s, String::default());
|
27 | 27 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(s)`
|
28 | 28 |
|
29 | 29 | error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
|
30 |
| - --> $DIR/mem_replace.rs:24:13 |
| 30 | + --> $DIR/mem_replace.rs:26:13 |
31 | 31 | |
|
32 | 32 | LL | let _ = std::mem::replace(s, Default::default());
|
33 | 33 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(s)`
|
34 | 34 |
|
35 |
| -error: aborting due to 5 previous errors |
| 35 | +error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` |
| 36 | + --> $DIR/mem_replace.rs:29:13 |
| 37 | + | |
| 38 | +LL | let _ = std::mem::replace(&mut v, Vec::default()); |
| 39 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut v)` |
| 40 | + |
| 41 | +error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` |
| 42 | + --> $DIR/mem_replace.rs:30:13 |
| 43 | + | |
| 44 | +LL | let _ = std::mem::replace(&mut v, Default::default()); |
| 45 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut v)` |
| 46 | + |
| 47 | +error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` |
| 48 | + --> $DIR/mem_replace.rs:31:13 |
| 49 | + | |
| 50 | +LL | let _ = std::mem::replace(&mut v, Vec::new()); |
| 51 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut v)` |
| 52 | + |
| 53 | +error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` |
| 54 | + --> $DIR/mem_replace.rs:32:13 |
| 55 | + | |
| 56 | +LL | let _ = std::mem::replace(&mut v, vec![]); |
| 57 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut v)` |
| 58 | + |
| 59 | +error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` |
| 60 | + --> $DIR/mem_replace.rs:35:13 |
| 61 | + | |
| 62 | +LL | let _ = std::mem::replace(&mut hash_map, HashMap::new()); |
| 63 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut hash_map)` |
| 64 | + |
| 65 | +error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` |
| 66 | + --> $DIR/mem_replace.rs:38:13 |
| 67 | + | |
| 68 | +LL | let _ = std::mem::replace(&mut btree_map, BTreeMap::new()); |
| 69 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut btree_map)` |
| 70 | + |
| 71 | +error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` |
| 72 | + --> $DIR/mem_replace.rs:41:13 |
| 73 | + | |
| 74 | +LL | let _ = std::mem::replace(&mut vd, VecDeque::new()); |
| 75 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut vd)` |
| 76 | + |
| 77 | +error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` |
| 78 | + --> $DIR/mem_replace.rs:44:13 |
| 79 | + | |
| 80 | +LL | let _ = std::mem::replace(&mut hash_set, HashSet::new()); |
| 81 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut hash_set)` |
| 82 | + |
| 83 | +error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` |
| 84 | + --> $DIR/mem_replace.rs:47:13 |
| 85 | + | |
| 86 | +LL | let _ = std::mem::replace(&mut btree_set, BTreeSet::new()); |
| 87 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut btree_set)` |
| 88 | + |
| 89 | +error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` |
| 90 | + --> $DIR/mem_replace.rs:50:13 |
| 91 | + | |
| 92 | +LL | let _ = std::mem::replace(&mut list, LinkedList::new()); |
| 93 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut list)` |
| 94 | + |
| 95 | +error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` |
| 96 | + --> $DIR/mem_replace.rs:53:13 |
| 97 | + | |
| 98 | +LL | let _ = std::mem::replace(&mut binary_heap, BinaryHeap::new()); |
| 99 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut binary_heap)` |
| 100 | + |
| 101 | +error: aborting due to 16 previous errors |
36 | 102 |
|
0 commit comments