1
1
error: assigning the result of `Clone::clone()` may be inefficient
2
- --> $DIR/assigning_clones.rs:25 :5
2
+ --> $DIR/assigning_clones.rs:24 :5
3
3
|
4
4
LL | *mut_thing = value_thing.clone();
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `mut_thing.clone_from(&value_thing)`
@@ -8,97 +8,97 @@ LL | *mut_thing = value_thing.clone();
8
8
= help: to override `-D warnings` add `#[allow(clippy::assigning_clones)]`
9
9
10
10
error: assigning the result of `Clone::clone()` may be inefficient
11
- --> $DIR/assigning_clones.rs:29 :5
11
+ --> $DIR/assigning_clones.rs:28 :5
12
12
|
13
13
LL | *mut_thing = ref_thing.clone();
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `mut_thing.clone_from(ref_thing)`
15
15
16
16
error: assigning the result of `Clone::clone()` may be inefficient
17
- --> $DIR/assigning_clones.rs:33 :5
17
+ --> $DIR/assigning_clones.rs:32 :5
18
18
|
19
19
LL | mut_thing = ref_thing.clone();
20
20
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `mut_thing.clone_from(ref_thing)`
21
21
22
22
error: assigning the result of `Clone::clone()` may be inefficient
23
- --> $DIR/assigning_clones.rs:37 :5
23
+ --> $DIR/assigning_clones.rs:36 :5
24
24
|
25
25
LL | *mut_thing = Clone::clone(ref_thing);
26
26
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(mut_thing, ref_thing)`
27
27
28
28
error: assigning the result of `Clone::clone()` may be inefficient
29
- --> $DIR/assigning_clones.rs:41 :5
29
+ --> $DIR/assigning_clones.rs:40 :5
30
30
|
31
31
LL | mut_thing = Clone::clone(ref_thing);
32
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(&mut mut_thing, ref_thing)`
33
33
34
34
error: assigning the result of `Clone::clone()` may be inefficient
35
- --> $DIR/assigning_clones.rs:45 :5
35
+ --> $DIR/assigning_clones.rs:44 :5
36
36
|
37
37
LL | *mut_thing = Clone::clone(ref_thing);
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(mut_thing, ref_thing)`
39
39
40
40
error: assigning the result of `Clone::clone()` may be inefficient
41
- --> $DIR/assigning_clones.rs:49 :5
41
+ --> $DIR/assigning_clones.rs:48 :5
42
42
|
43
43
LL | *mut_thing = HasCloneFrom::clone(ref_thing);
44
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(mut_thing, ref_thing)`
45
45
46
46
error: assigning the result of `Clone::clone()` may be inefficient
47
- --> $DIR/assigning_clones.rs:53 :5
47
+ --> $DIR/assigning_clones.rs:52 :5
48
48
|
49
49
LL | *mut_thing = <HasCloneFrom as Clone>::clone(ref_thing);
50
50
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `Clone::clone_from(mut_thing, ref_thing)`
51
51
52
52
error: assigning the result of `Clone::clone()` may be inefficient
53
- --> $DIR/assigning_clones.rs:58 :5
53
+ --> $DIR/assigning_clones.rs:57 :5
54
54
|
55
55
LL | *(mut_thing + &mut HasCloneFrom) = ref_thing.clone();
56
56
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `(mut_thing + &mut HasCloneFrom).clone_from(ref_thing)`
57
57
58
58
error: assigning the result of `Clone::clone()` may be inefficient
59
- --> $DIR/assigning_clones.rs:63 :5
59
+ --> $DIR/assigning_clones.rs:62 :5
60
60
|
61
61
LL | *mut_thing = (ref_thing + ref_thing).clone();
62
62
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `mut_thing.clone_from(ref_thing + ref_thing)`
63
63
64
64
error: assigning the result of `Clone::clone()` may be inefficient
65
- --> $DIR/assigning_clones.rs:69 :9
65
+ --> $DIR/assigning_clones.rs:68 :9
66
66
|
67
67
LL | a = b.clone();
68
68
| ^^^^^^^^^^^^^ help: use `clone_from()`: `a.clone_from(&b)`
69
69
70
70
error: assigning the result of `ToOwned::to_owned()` may be inefficient
71
- --> $DIR/assigning_clones.rs:146 :5
71
+ --> $DIR/assigning_clones.rs:145 :5
72
72
|
73
73
LL | *mut_string = ref_str.to_owned();
74
74
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(mut_string)`
75
75
76
76
error: assigning the result of `ToOwned::to_owned()` may be inefficient
77
- --> $DIR/assigning_clones.rs:150 :5
77
+ --> $DIR/assigning_clones.rs:149 :5
78
78
|
79
79
LL | mut_string = ref_str.to_owned();
80
80
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(&mut mut_string)`
81
81
82
82
error: assigning the result of `ToOwned::to_owned()` may be inefficient
83
- --> $DIR/assigning_clones.rs:171 :5
83
+ --> $DIR/assigning_clones.rs:170 :5
84
84
|
85
85
LL | **mut_box_string = ref_str.to_owned();
86
86
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(&mut (*mut_box_string))`
87
87
88
88
error: assigning the result of `ToOwned::to_owned()` may be inefficient
89
- --> $DIR/assigning_clones.rs:175 :5
89
+ --> $DIR/assigning_clones.rs:174 :5
90
90
|
91
91
LL | **mut_box_string = ref_str.to_owned();
92
92
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ref_str.clone_into(&mut (*mut_box_string))`
93
93
94
94
error: assigning the result of `ToOwned::to_owned()` may be inefficient
95
- --> $DIR/assigning_clones.rs:179 :5
95
+ --> $DIR/assigning_clones.rs:178 :5
96
96
|
97
97
LL | *mut_thing = ToOwned::to_owned(ref_str);
98
98
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ToOwned::clone_into(ref_str, mut_thing)`
99
99
100
100
error: assigning the result of `ToOwned::to_owned()` may be inefficient
101
- --> $DIR/assigning_clones.rs:183 :5
101
+ --> $DIR/assigning_clones.rs:182 :5
102
102
|
103
103
LL | mut_thing = ToOwned::to_owned(ref_str);
104
104
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `ToOwned::clone_into(ref_str, &mut mut_thing)`
0 commit comments