@@ -5,51 +5,59 @@ LL | let _ = cow.to_owned();
5
5
| ^^^^^^^^^^^^^^
6
6
|
7
7
= note: `-D clippy::suspicious-to-owned` implied by `-D warnings`
8
- help: depending on intent, either make the Cow an Owned variant or clone the Cow itself
8
+ help: depending on intent, either make the Cow an Owned variant
9
9
|
10
- LL | let _ = cow.clone();
11
- | ~~~~~~~~~~~
12
10
LL | let _ = cow.into_owned();
13
11
| ~~~~~~~~~~~~~~~~
12
+ help: or clone the Cow itself
13
+ |
14
+ LL | let _ = cow.clone();
15
+ | ~~~~~~~~~~~
14
16
15
17
error: this `to_owned` call clones the Cow<'_, [char; 3]> itself and does not cause the Cow<'_, [char; 3]> contents to become owned
16
18
--> $DIR/suspicious_to_owned.rs:26:13
17
19
|
18
20
LL | let _ = cow.to_owned();
19
21
| ^^^^^^^^^^^^^^
20
22
|
21
- help: depending on intent, either make the Cow an Owned variant or clone the Cow itself
23
+ help: depending on intent, either make the Cow an Owned variant
22
24
|
23
- LL | let _ = cow.clone();
24
- | ~~~~~~~~~~~
25
25
LL | let _ = cow.into_owned();
26
26
| ~~~~~~~~~~~~~~~~
27
+ help: or clone the Cow itself
28
+ |
29
+ LL | let _ = cow.clone();
30
+ | ~~~~~~~~~~~
27
31
28
32
error: this `to_owned` call clones the Cow<'_, Vec<char>> itself and does not cause the Cow<'_, Vec<char>> contents to become owned
29
33
--> $DIR/suspicious_to_owned.rs:36:13
30
34
|
31
35
LL | let _ = cow.to_owned();
32
36
| ^^^^^^^^^^^^^^
33
37
|
34
- help: depending on intent, either make the Cow an Owned variant or clone the Cow itself
38
+ help: depending on intent, either make the Cow an Owned variant
35
39
|
36
- LL | let _ = cow.clone();
37
- | ~~~~~~~~~~~
38
40
LL | let _ = cow.into_owned();
39
41
| ~~~~~~~~~~~~~~~~
42
+ help: or clone the Cow itself
43
+ |
44
+ LL | let _ = cow.clone();
45
+ | ~~~~~~~~~~~
40
46
41
47
error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned
42
48
--> $DIR/suspicious_to_owned.rs:46:13
43
49
|
44
50
LL | let _ = cow.to_owned();
45
51
| ^^^^^^^^^^^^^^
46
52
|
47
- help: depending on intent, either make the Cow an Owned variant or clone the Cow itself
53
+ help: depending on intent, either make the Cow an Owned variant
48
54
|
49
- LL | let _ = cow.clone();
50
- | ~~~~~~~~~~~
51
55
LL | let _ = cow.into_owned();
52
56
| ~~~~~~~~~~~~~~~~
57
+ help: or clone the Cow itself
58
+ |
59
+ LL | let _ = cow.clone();
60
+ | ~~~~~~~~~~~
53
61
54
62
error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
55
63
--> $DIR/suspicious_to_owned.rs:60:13
0 commit comments