11error: assigning the result of `Clone::clone()` may be inefficient
2- --> $DIR/assigning_clones.rs:25 :5
2+ --> $DIR/assigning_clones.rs:24 :5
33 |
44LL | *mut_thing = value_thing.clone();
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `mut_thing.clone_from(&value_thing)`
@@ -8,97 +8,97 @@ LL | *mut_thing = value_thing.clone();
88 = help: to override `-D warnings` add `#[allow(clippy::assigning_clones)]`
99
1010error: assigning the result of `Clone::clone()` may be inefficient
11- --> $DIR/assigning_clones.rs:29 :5
11+ --> $DIR/assigning_clones.rs:28 :5
1212 |
1313LL | *mut_thing = ref_thing.clone();
1414 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `mut_thing.clone_from(ref_thing)`
1515
1616error: assigning the result of `Clone::clone()` may be inefficient
17- --> $DIR/assigning_clones.rs:33 :5
17+ --> $DIR/assigning_clones.rs:32 :5
1818 |
1919LL | mut_thing = ref_thing.clone();
2020 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `mut_thing.clone_from(ref_thing)`
2121
2222error: assigning the result of `Clone::clone()` may be inefficient
23- --> $DIR/assigning_clones.rs:37 :5
23+ --> $DIR/assigning_clones.rs:36 :5
2424 |
2525LL | *mut_thing = Clone::clone(ref_thing);
2626 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(mut_thing, ref_thing)`
2727
2828error: assigning the result of `Clone::clone()` may be inefficient
29- --> $DIR/assigning_clones.rs:41 :5
29+ --> $DIR/assigning_clones.rs:40 :5
3030 |
3131LL | mut_thing = Clone::clone(ref_thing);
3232 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(&mut mut_thing, ref_thing)`
3333
3434error: assigning the result of `Clone::clone()` may be inefficient
35- --> $DIR/assigning_clones.rs:45 :5
35+ --> $DIR/assigning_clones.rs:44 :5
3636 |
3737LL | *mut_thing = Clone::clone(ref_thing);
3838 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(mut_thing, ref_thing)`
3939
4040error: assigning the result of `Clone::clone()` may be inefficient
41- --> $DIR/assigning_clones.rs:49 :5
41+ --> $DIR/assigning_clones.rs:48 :5
4242 |
4343LL | *mut_thing = HasCloneFrom::clone(ref_thing);
4444 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(mut_thing, ref_thing)`
4545
4646error: assigning the result of `Clone::clone()` may be inefficient
47- --> $DIR/assigning_clones.rs:53 :5
47+ --> $DIR/assigning_clones.rs:52 :5
4848 |
4949LL | *mut_thing = <HasCloneFrom as Clone>::clone(ref_thing);
5050 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(mut_thing, ref_thing)`
5151
5252error: assigning the result of `Clone::clone()` may be inefficient
53- --> $DIR/assigning_clones.rs:58 :5
53+ --> $DIR/assigning_clones.rs:57 :5
5454 |
5555LL | *(mut_thing + &mut HasCloneFrom) = ref_thing.clone();
5656 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `(mut_thing + &mut HasCloneFrom).clone_from(ref_thing)`
5757
5858error: assigning the result of `Clone::clone()` may be inefficient
59- --> $DIR/assigning_clones.rs:63 :5
59+ --> $DIR/assigning_clones.rs:62 :5
6060 |
6161LL | *mut_thing = (ref_thing + ref_thing).clone();
6262 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `mut_thing.clone_from(ref_thing + ref_thing)`
6363
6464error: assigning the result of `Clone::clone()` may be inefficient
65- --> $DIR/assigning_clones.rs:69 :9
65+ --> $DIR/assigning_clones.rs:68 :9
6666 |
6767LL | a = b.clone();
6868 | ^^^^^^^^^^^^^ help: use `clone_from()`: `a.clone_from(&b)`
6969
7070error: assigning the result of `ToOwned::to_owned()` may be inefficient
71- --> $DIR/assigning_clones.rs:146 :5
71+ --> $DIR/assigning_clones.rs:145 :5
7272 |
7373LL | *mut_string = ref_str.to_owned();
7474 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(mut_string)`
7575
7676error: assigning the result of `ToOwned::to_owned()` may be inefficient
77- --> $DIR/assigning_clones.rs:150 :5
77+ --> $DIR/assigning_clones.rs:149 :5
7878 |
7979LL | mut_string = ref_str.to_owned();
8080 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(&mut mut_string)`
8181
8282error: assigning the result of `ToOwned::to_owned()` may be inefficient
83- --> $DIR/assigning_clones.rs:171 :5
83+ --> $DIR/assigning_clones.rs:170 :5
8484 |
8585LL | **mut_box_string = ref_str.to_owned();
8686 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(&mut (*mut_box_string))`
8787
8888error: assigning the result of `ToOwned::to_owned()` may be inefficient
89- --> $DIR/assigning_clones.rs:175 :5
89+ --> $DIR/assigning_clones.rs:174 :5
9090 |
9191LL | **mut_box_string = ref_str.to_owned();
9292 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(&mut (*mut_box_string))`
9393
9494error: assigning the result of `ToOwned::to_owned()` may be inefficient
95- --> $DIR/assigning_clones.rs:179 :5
95+ --> $DIR/assigning_clones.rs:178 :5
9696 |
9797LL | *mut_thing = ToOwned::to_owned(ref_str);
9898 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ToOwned::clone_into(ref_str, mut_thing)`
9999
100100error: assigning the result of `ToOwned::to_owned()` may be inefficient
101- --> $DIR/assigning_clones.rs:183 :5
101+ --> $DIR/assigning_clones.rs:182 :5
102102 |
103103LL | mut_thing = ToOwned::to_owned(ref_str);
104104 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ToOwned::clone_into(ref_str, &mut mut_thing)`
0 commit comments