@@ -5,51 +5,59 @@ LL | let _ = cow.to_owned();
55 | ^^^^^^^^^^^^^^
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
8+ help: depending on intent, either make the Cow an Owned variant
99 |
10- LL | let _ = cow.clone();
11- | ~~~~~~~~~~~
1210LL | let _ = cow.into_owned();
1311 | ~~~~~~~~~~~~~~~~
12+ help: or clone the Cow itself
13+ |
14+ LL | let _ = cow.clone();
15+ | ~~~~~~~~~~~
1416
1517error: this `to_owned` call clones the Cow<'_, [char; 3]> itself and does not cause the Cow<'_, [char; 3]> contents to become owned
1618 --> $DIR/suspicious_to_owned.rs:26:13
1719 |
1820LL | let _ = cow.to_owned();
1921 | ^^^^^^^^^^^^^^
2022 |
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
2224 |
23- LL | let _ = cow.clone();
24- | ~~~~~~~~~~~
2525LL | let _ = cow.into_owned();
2626 | ~~~~~~~~~~~~~~~~
27+ help: or clone the Cow itself
28+ |
29+ LL | let _ = cow.clone();
30+ | ~~~~~~~~~~~
2731
2832error: this `to_owned` call clones the Cow<'_, Vec<char>> itself and does not cause the Cow<'_, Vec<char>> contents to become owned
2933 --> $DIR/suspicious_to_owned.rs:36:13
3034 |
3135LL | let _ = cow.to_owned();
3236 | ^^^^^^^^^^^^^^
3337 |
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
3539 |
36- LL | let _ = cow.clone();
37- | ~~~~~~~~~~~
3840LL | let _ = cow.into_owned();
3941 | ~~~~~~~~~~~~~~~~
42+ help: or clone the Cow itself
43+ |
44+ LL | let _ = cow.clone();
45+ | ~~~~~~~~~~~
4046
4147error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned
4248 --> $DIR/suspicious_to_owned.rs:46:13
4349 |
4450LL | let _ = cow.to_owned();
4551 | ^^^^^^^^^^^^^^
4652 |
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
4854 |
49- LL | let _ = cow.clone();
50- | ~~~~~~~~~~~
5155LL | let _ = cow.into_owned();
5256 | ~~~~~~~~~~~~~~~~
57+ help: or clone the Cow itself
58+ |
59+ LL | let _ = cow.clone();
60+ | ~~~~~~~~~~~
5361
5462error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
5563 --> $DIR/suspicious_to_owned.rs:60:13
0 commit comments