@@ -2,27 +2,54 @@ error: this `to_owned` call clones the Cow<'_, str> itself and does not cause th
22 --> $DIR/suspicious_to_owned.rs:16:13
33 |
44LL | let _ = cow.to_owned();
5- | ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
5+ | ^^^^^^^^^^^^^^
66 |
77 = 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+ | ~~~~~~~~~~~~~~~~
814
915error: this `to_owned` call clones the Cow<'_, [char; 3]> itself and does not cause the Cow<'_, [char; 3]> contents to become owned
1016 --> $DIR/suspicious_to_owned.rs:26:13
1117 |
1218LL | 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+ | ~~~~~~~~~~~~~~~~
1427
1528error: this `to_owned` call clones the Cow<'_, Vec<char>> itself and does not cause the Cow<'_, Vec<char>> contents to become owned
1629 --> $DIR/suspicious_to_owned.rs:36:13
1730 |
1831LL | 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+ | ~~~~~~~~~~~~~~~~
2040
2141error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned
2242 --> $DIR/suspicious_to_owned.rs:46:13
2343 |
2444LL | 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+ | ~~~~~~~~~~~~~~~~
2653
2754error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
2855 --> $DIR/suspicious_to_owned.rs:60:13
0 commit comments