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