@@ -2,27 +2,62 @@ 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
9+ |
10+ LL | let _ = cow.into_owned();
11+ | ~~~~~~~~~~~~~~~~
12+ help: or clone the Cow itself
13+ |
14+ LL | let _ = cow.clone();
15+ | ~~~~~~~~~~~
816
917error: this `to_owned` call clones the Cow<'_, [char; 3]> itself and does not cause the Cow<'_, [char; 3]> contents to become owned
1018 --> $DIR/suspicious_to_owned.rs:26:13
1119 |
1220LL | let _ = cow.to_owned();
13- | ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
21+ | ^^^^^^^^^^^^^^
22+ |
23+ help: depending on intent, either make the Cow an Owned variant
24+ |
25+ LL | let _ = cow.into_owned();
26+ | ~~~~~~~~~~~~~~~~
27+ help: or clone the Cow itself
28+ |
29+ LL | let _ = cow.clone();
30+ | ~~~~~~~~~~~
1431
1532error: this `to_owned` call clones the Cow<'_, Vec<char>> itself and does not cause the Cow<'_, Vec<char>> contents to become owned
1633 --> $DIR/suspicious_to_owned.rs:36:13
1734 |
1835LL | let _ = cow.to_owned();
19- | ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
36+ | ^^^^^^^^^^^^^^
37+ |
38+ help: depending on intent, either make the Cow an Owned variant
39+ |
40+ LL | let _ = cow.into_owned();
41+ | ~~~~~~~~~~~~~~~~
42+ help: or clone the Cow itself
43+ |
44+ LL | let _ = cow.clone();
45+ | ~~~~~~~~~~~
2046
2147error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned
2248 --> $DIR/suspicious_to_owned.rs:46:13
2349 |
2450LL | let _ = cow.to_owned();
25- | ^^^^^^^^^^^^^^ help: consider using, depending on intent: `cow.clone()` or `cow.into_owned()`
51+ | ^^^^^^^^^^^^^^
52+ |
53+ help: depending on intent, either make the Cow an Owned variant
54+ |
55+ LL | let _ = cow.into_owned();
56+ | ~~~~~~~~~~~~~~~~
57+ help: or clone the Cow itself
58+ |
59+ LL | let _ = cow.clone();
60+ | ~~~~~~~~~~~
2661
2762error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
2863 --> $DIR/suspicious_to_owned.rs:60:13
0 commit comments