2023-01-12 12:48:13 -06:00
|
|
|
error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/suspicious_to_owned.rs:17:13
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
LL | let _ = cow.to_owned();
|
2023-02-10 07:01:19 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::suspicious-to-owned` implied by `-D warnings`
|
2023-02-10 07:01:19 -06:00
|
|
|
help: depending on intent, either make the Cow an Owned variant
|
|
|
|
|
|
|
|
|
LL | let _ = cow.into_owned();
|
|
|
|
| ~~~~~~~~~~~~~~~~
|
|
|
|
help: or clone the Cow itself
|
|
|
|
|
|
|
|
|
LL | let _ = cow.clone();
|
|
|
|
| ~~~~~~~~~~~
|
2022-08-31 08:24:45 -05:00
|
|
|
|
2023-01-12 12:48:13 -06:00
|
|
|
error: this `to_owned` call clones the Cow<'_, [char; 3]> itself and does not cause the Cow<'_, [char; 3]> contents to become owned
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/suspicious_to_owned.rs:29:13
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
LL | let _ = cow.to_owned();
|
2023-02-10 07:01:19 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: depending on intent, either make the Cow an Owned variant
|
|
|
|
|
|
|
|
|
LL | let _ = cow.into_owned();
|
|
|
|
| ~~~~~~~~~~~~~~~~
|
|
|
|
help: or clone the Cow itself
|
|
|
|
|
|
|
|
|
LL | let _ = cow.clone();
|
|
|
|
| ~~~~~~~~~~~
|
2022-08-31 08:24:45 -05:00
|
|
|
|
2023-01-12 12:48:13 -06:00
|
|
|
error: this `to_owned` call clones the Cow<'_, Vec<char>> itself and does not cause the Cow<'_, Vec<char>> contents to become owned
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/suspicious_to_owned.rs:40:13
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
LL | let _ = cow.to_owned();
|
2023-02-10 07:01:19 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: depending on intent, either make the Cow an Owned variant
|
|
|
|
|
|
|
|
|
LL | let _ = cow.into_owned();
|
|
|
|
| ~~~~~~~~~~~~~~~~
|
|
|
|
help: or clone the Cow itself
|
|
|
|
|
|
|
|
|
LL | let _ = cow.clone();
|
|
|
|
| ~~~~~~~~~~~
|
2022-08-31 08:24:45 -05:00
|
|
|
|
2023-01-12 12:48:13 -06:00
|
|
|
error: this `to_owned` call clones the Cow<'_, str> itself and does not cause the Cow<'_, str> contents to become owned
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/suspicious_to_owned.rs:51:13
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
LL | let _ = cow.to_owned();
|
2023-02-10 07:01:19 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: depending on intent, either make the Cow an Owned variant
|
|
|
|
|
|
|
|
|
LL | let _ = cow.into_owned();
|
|
|
|
| ~~~~~~~~~~~~~~~~
|
|
|
|
help: or clone the Cow itself
|
|
|
|
|
|
|
|
|
LL | let _ = cow.clone();
|
|
|
|
| ~~~~~~~~~~~
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
error: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/suspicious_to_owned.rs:66:13
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
LL | let _ = String::from(moo).to_owned();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `String::from(moo).clone()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::implicit-clone` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: implicitly cloning a `Vec` by calling `to_owned` on its dereferenced type
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/suspicious_to_owned.rs:69:13
|
2022-08-31 08:24:45 -05:00
|
|
|
|
|
|
|
|
LL | let _ = moos_vec.to_owned();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: consider using: `moos_vec.clone()`
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
|
|
|
|