]>
Commit | Line | Data |
---|---|---|
9c376795 | 1 | error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned |
781aab86 | 2 | --> $DIR/suspicious_to_owned.rs:17:13 |
f2b60f7d FG |
3 | | |
4 | LL | let _ = cow.to_owned(); | |
9ffffee4 | 5 | | ^^^^^^^^^^^^^^ |
f2b60f7d FG |
6 | | |
7 | = note: `-D clippy::suspicious-to-owned` implied by `-D warnings` | |
781aab86 | 8 | = help: to override `-D warnings` add `#[allow(clippy::suspicious_to_owned)]` |
9ffffee4 FG |
9 | help: depending on intent, either make the Cow an Owned variant |
10 | | | |
11 | LL | let _ = cow.into_owned(); | |
12 | | ~~~~~~~~~~~~~~~~ | |
13 | help: or clone the Cow itself | |
14 | | | |
15 | LL | let _ = cow.clone(); | |
16 | | ~~~~~~~~~~~ | |
f2b60f7d | 17 | |
9c376795 | 18 | error: this `to_owned` call clones the Cow<'_, [char; 3]> itself and does not cause the Cow<'_, [char; 3]> contents to become owned |
781aab86 | 19 | --> $DIR/suspicious_to_owned.rs:29:13 |
f2b60f7d FG |
20 | | |
21 | LL | let _ = cow.to_owned(); | |
9ffffee4 FG |
22 | | ^^^^^^^^^^^^^^ |
23 | | | |
24 | help: depending on intent, either make the Cow an Owned variant | |
25 | | | |
26 | LL | let _ = cow.into_owned(); | |
27 | | ~~~~~~~~~~~~~~~~ | |
28 | help: or clone the Cow itself | |
29 | | | |
30 | LL | let _ = cow.clone(); | |
31 | | ~~~~~~~~~~~ | |
f2b60f7d | 32 | |
9c376795 | 33 | error: this `to_owned` call clones the Cow<'_, Vec<char>> itself and does not cause the Cow<'_, Vec<char>> contents to become owned |
781aab86 | 34 | --> $DIR/suspicious_to_owned.rs:40:13 |
f2b60f7d FG |
35 | | |
36 | LL | let _ = cow.to_owned(); | |
9ffffee4 FG |
37 | | ^^^^^^^^^^^^^^ |
38 | | | |
39 | help: depending on intent, either make the Cow an Owned variant | |
40 | | | |
41 | LL | let _ = cow.into_owned(); | |
42 | | ~~~~~~~~~~~~~~~~ | |
43 | help: or clone the Cow itself | |
44 | | | |
45 | LL | let _ = cow.clone(); | |
46 | | ~~~~~~~~~~~ | |
f2b60f7d | 47 | |
9c376795 | 48 | error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned |
781aab86 | 49 | --> $DIR/suspicious_to_owned.rs:51:13 |
f2b60f7d FG |
50 | | |
51 | LL | let _ = cow.to_owned(); | |
9ffffee4 FG |
52 | | ^^^^^^^^^^^^^^ |
53 | | | |
54 | help: depending on intent, either make the Cow an Owned variant | |
55 | | | |
56 | LL | let _ = cow.into_owned(); | |
57 | | ~~~~~~~~~~~~~~~~ | |
58 | help: or clone the Cow itself | |
59 | | | |
60 | LL | let _ = cow.clone(); | |
61 | | ~~~~~~~~~~~ | |
f2b60f7d FG |
62 | |
63 | error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type | |
781aab86 | 64 | --> $DIR/suspicious_to_owned.rs:66:13 |
f2b60f7d FG |
65 | | |
66 | LL | let _ = String::from(moo).to_owned(); | |
67 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `String::from(moo).clone()` | |
68 | | | |
69 | = note: `-D clippy::implicit-clone` implied by `-D warnings` | |
781aab86 | 70 | = help: to override `-D warnings` add `#[allow(clippy::implicit_clone)]` |
f2b60f7d FG |
71 | |
72 | error: implicitly cloning a `Vec` by calling `to_owned` on its dereferenced type | |
781aab86 | 73 | --> $DIR/suspicious_to_owned.rs:69:13 |
f2b60f7d FG |
74 | | |
75 | LL | let _ = moos_vec.to_owned(); | |
76 | | ^^^^^^^^^^^^^^^^^^^ help: consider using: `moos_vec.clone()` | |
77 | ||
78 | error: aborting due to 6 previous errors | |
79 |