2021-12-17 06:40:22 -06:00
|
|
|
error: redundant clone
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:157:64
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_c_str(&CString::from_vec_with_nul(vec![0]).unwrap().to_owned());
|
|
|
|
| ^^^^^^^^^^^ help: remove this
|
|
|
|
|
|
|
|
|
note: this value is dropped without further use
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:157:20
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_c_str(&CString::from_vec_with_nul(vec![0]).unwrap().to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-09-22 11:04:22 -05:00
|
|
|
= note: `-D clippy::redundant-clone` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::redundant_clone)]`
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
error: redundant clone
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:158:40
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_os_str(&OsString::from("x").to_os_string());
|
|
|
|
| ^^^^^^^^^^^^^^^ help: remove this
|
|
|
|
|
|
|
|
|
note: this value is dropped without further use
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:158:21
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_os_str(&OsString::from("x").to_os_string());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: redundant clone
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:159:48
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_path(&std::path::PathBuf::from("x").to_path_buf());
|
|
|
|
| ^^^^^^^^^^^^^^ help: remove this
|
|
|
|
|
|
|
|
|
note: this value is dropped without further use
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:159:19
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_path(&std::path::PathBuf::from("x").to_path_buf());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: redundant clone
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:160:35
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_str(&String::from("x").to_string());
|
|
|
|
| ^^^^^^^^^^^^ help: remove this
|
|
|
|
|
|
|
|
|
note: this value is dropped without further use
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:160:18
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_str(&String::from("x").to_string());
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-05-21 06:24:00 -05:00
|
|
|
error: redundant clone
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:161:39
|
2022-05-21 06:24:00 -05:00
|
|
|
|
|
|
|
|
LL | require_slice(&[String::from("x")].to_owned());
|
|
|
|
| ^^^^^^^^^^^ help: remove this
|
|
|
|
|
|
|
|
|
note: this value is dropped without further use
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:161:20
|
2022-05-21 06:24:00 -05:00
|
|
|
|
|
|
|
|
LL | require_slice(&[String::from("x")].to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-12-17 06:40:22 -06:00
|
|
|
error: unnecessary use of `into_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:66:36
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_c_str(&Cow::from(c_str).into_owned());
|
|
|
|
| ^^^^^^^^^^^^^ help: remove this
|
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-to-owned` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_to_owned)]`
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:67:19
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_c_str(&c_str.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: use: `c_str`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_os_string`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:69:20
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_os_str(&os_str.to_os_string());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: use: `os_str`
|
|
|
|
|
|
|
|
error: unnecessary use of `into_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:70:38
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_os_str(&Cow::from(os_str).into_owned());
|
|
|
|
| ^^^^^^^^^^^^^ help: remove this
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:71:20
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_os_str(&os_str.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: use: `os_str`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_path_buf`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:73:18
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_path(&path.to_path_buf());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: use: `path`
|
|
|
|
|
|
|
|
error: unnecessary use of `into_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:74:34
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_path(&Cow::from(path).into_owned());
|
|
|
|
| ^^^^^^^^^^^^^ help: remove this
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:75:18
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_path(&path.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `path`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_string`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:77:17
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_str(&s.to_string());
|
|
|
|
| ^^^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `into_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:78:30
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_str(&Cow::from(s).into_owned());
|
|
|
|
| ^^^^^^^^^^^^^ help: remove this
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:79:17
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_str(&s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_string`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:80:17
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_str(&x_ref.to_string());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: use: `x_ref.as_ref()`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_vec`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:82:19
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_slice(&slice.to_vec());
|
|
|
|
| ^^^^^^^^^^^^^^^ help: use: `slice`
|
|
|
|
|
|
|
|
error: unnecessary use of `into_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:83:36
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_slice(&Cow::from(slice).into_owned());
|
|
|
|
| ^^^^^^^^^^^^^ help: remove this
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:84:19
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_slice(&array.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: use: `array.as_ref()`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:85:19
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_slice(&array_ref.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref.as_ref()`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:86:19
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_slice(&slice.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: use: `slice`
|
|
|
|
|
|
|
|
error: unnecessary use of `into_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:89:42
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_x(&Cow::<X>::Owned(x.clone()).into_owned());
|
|
|
|
| ^^^^^^^^^^^^^ help: remove this
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:92:25
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_deref_c_str(c_str.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `c_str`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:93:26
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_deref_os_str(os_str.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: use: `os_str`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:94:24
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_deref_path(path.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^ help: use: `path`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:95:23
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_deref_str(s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:96:25
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_deref_slice(slice.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `slice`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:98:30
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_deref_c_str(c_str.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `c_str`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:99:31
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_deref_os_str(os_str.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: use: `os_str`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:100:29
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_deref_path(path.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^ help: use: `path`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:101:28
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_deref_str(s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:102:30
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_deref_slice(slice.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `slice`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:104:29
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_deref_str_slice(s.to_owned(), slice.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:104:43
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_deref_str_slice(s.to_owned(), slice.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `slice`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:105:29
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_deref_slice_str(slice.to_owned(), s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `slice`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:105:47
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_deref_slice_str(slice.to_owned(), s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:107:26
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_c_str(c_str.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `c_str`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:108:27
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_os_str(os_str.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: use: `os_str`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:109:25
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_path(path.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^ help: use: `path`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:110:24
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_str(s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:111:24
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_str(x.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `&x`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:112:26
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_slice(array.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `array`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:113:26
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_slice(array_ref.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:114:26
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_slice(slice.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `slice`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:116:31
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_as_ref_c_str(c_str.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `c_str`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:117:32
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_as_ref_os_str(os_str.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: use: `os_str`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:118:30
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_as_ref_path(path.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^ help: use: `path`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:119:29
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_as_ref_str(s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:120:29
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_as_ref_str(x.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `&x`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:121:31
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_as_ref_slice(array.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `array`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:122:31
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_as_ref_slice(array_ref.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:123:31
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_impl_as_ref_slice(slice.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `slice`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:125:30
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_str_slice(s.to_owned(), array.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:125:44
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_str_slice(s.to_owned(), array.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `array`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:126:30
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_str_slice(s.to_owned(), array_ref.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:126:44
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_str_slice(s.to_owned(), array_ref.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:127:30
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_str_slice(s.to_owned(), slice.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:127:44
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_str_slice(s.to_owned(), slice.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `slice`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:128:30
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_slice_str(array.to_owned(), s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `array`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:128:48
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_slice_str(array.to_owned(), s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:129:30
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_slice_str(array_ref.to_owned(), s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: use: `array_ref`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:129:52
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_slice_str(array_ref.to_owned(), s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:130:30
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_slice_str(slice.to_owned(), s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: use: `slice`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:130:48
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | require_as_ref_slice_str(slice.to_owned(), s.to_owned());
|
|
|
|
| ^^^^^^^^^^^^ help: use: `s`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_string`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:132:20
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | let _ = x.join(&x_ref.to_string());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: use: `x_ref`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_vec`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:134:13
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | let _ = slice.to_vec().into_iter();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:135:13
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | let _ = slice.to_owned().into_iter();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_vec`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:136:13
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | let _ = [std::path::PathBuf::new()][..].to_vec().into_iter();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:137:13
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | let _ = [std::path::PathBuf::new()][..].to_owned().into_iter();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_vec`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:139:13
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | let _ = IntoIterator::into_iter(slice.to_vec());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:140:13
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | let _ = IntoIterator::into_iter(slice.to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `slice.iter().copied()`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_vec`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:141:13
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | let _ = IntoIterator::into_iter([std::path::PathBuf::new()][..].to_vec());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:142:13
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | let _ = IntoIterator::into_iter([std::path::PathBuf::new()][..].to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[std::path::PathBuf::new()][..].iter().cloned()`
|
|
|
|
|
2024-06-19 17:09:31 -05:00
|
|
|
error: allocating a new `String` only to create a temporary `&str` from it
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:164:26
|
2024-06-19 17:09:31 -05:00
|
|
|
|
|
|
|
|
LL | let _ref_str: &str = &String::from_utf8(slice.to_vec()).expect("not UTF-8");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: convert from `&[u8]` to `&str` directly
|
|
|
|
|
|
|
|
|
LL - let _ref_str: &str = &String::from_utf8(slice.to_vec()).expect("not UTF-8");
|
|
|
|
LL + let _ref_str: &str = core::str::from_utf8(&slice).expect("not UTF-8");
|
|
|
|
|
|
|
|
|
|
|
|
|
error: allocating a new `String` only to create a temporary `&str` from it
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:165:26
|
2024-06-19 17:09:31 -05:00
|
|
|
|
|
|
|
|
LL | let _ref_str: &str = &String::from_utf8(b"foo".to_vec()).unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: convert from `&[u8]` to `&str` directly
|
|
|
|
|
|
|
|
|
LL - let _ref_str: &str = &String::from_utf8(b"foo".to_vec()).unwrap();
|
|
|
|
LL + let _ref_str: &str = core::str::from_utf8(b"foo").unwrap();
|
|
|
|
|
|
|
|
|
|
|
|
|
error: allocating a new `String` only to create a temporary `&str` from it
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:166:26
|
2024-06-19 17:09:31 -05:00
|
|
|
|
|
|
|
|
LL | let _ref_str: &str = &String::from_utf8(b"foo".as_slice().to_owned()).unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: convert from `&[u8]` to `&str` directly
|
|
|
|
|
|
|
|
|
LL - let _ref_str: &str = &String::from_utf8(b"foo".as_slice().to_owned()).unwrap();
|
|
|
|
LL + let _ref_str: &str = core::str::from_utf8(b"foo".as_slice()).unwrap();
|
|
|
|
|
|
|
|
|
|
2021-12-17 06:40:22 -06:00
|
|
|
error: unnecessary use of `to_vec`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:223:14
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL | for t in file_types.to_vec() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: use
|
|
|
|
|
|
|
|
|
LL | for t in file_types {
|
|
|
|
| ~~~~~~~~~~
|
2024-05-24 10:59:09 -05:00
|
|
|
help: remove any references to the binding
|
2021-12-17 06:40:22 -06:00
|
|
|
|
|
|
|
|
LL - let path = match get_file_path(&t) {
|
|
|
|
LL + let path = match get_file_path(t) {
|
2022-06-15 06:15:54 -05:00
|
|
|
|
|
2021-12-17 06:40:22 -06:00
|
|
|
|
2022-05-05 09:12:52 -05:00
|
|
|
error: unnecessary use of `to_vec`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:246:14
|
2022-05-05 09:12:52 -05:00
|
|
|
|
|
|
|
|
LL | let _ = &["x"][..].to_vec().into_iter();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `["x"][..].iter().cloned()`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_vec`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:251:14
|
2022-05-05 09:12:52 -05:00
|
|
|
|
|
|
|
|
LL | let _ = &["x"][..].to_vec().into_iter();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `["x"][..].iter().copied()`
|
|
|
|
|
2022-03-24 08:50:04 -05:00
|
|
|
error: unnecessary use of `to_string`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:299:24
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
|
|
|
LL | Box::new(build(y.to_string()))
|
|
|
|
| ^^^^^^^^^^^^^ help: use: `y`
|
|
|
|
|
2022-09-09 06:36:26 -05:00
|
|
|
error: unnecessary use of `to_string`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:408:12
|
2022-09-09 06:36:26 -05:00
|
|
|
|
|
|
|
|
LL | id("abc".to_string())
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: use: `"abc"`
|
|
|
|
|
2023-12-11 09:46:14 -06:00
|
|
|
error: unnecessary use of `to_vec`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:551:37
|
2023-12-11 09:46:14 -06:00
|
|
|
|
|
|
|
|
LL | IntoFuture::into_future(foo([].to_vec(), &0));
|
|
|
|
| ^^^^^^^^^^^ help: use: `[]`
|
|
|
|
|
2024-02-20 10:53:19 -06:00
|
|
|
error: unnecessary use of `to_vec`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:561:18
|
2024-02-20 10:53:19 -06:00
|
|
|
|
|
|
|
|
LL | s.remove(&a.to_vec());
|
|
|
|
| ^^^^^^^^^^^ help: replace it with: `a`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:565:14
|
2024-02-20 10:53:19 -06:00
|
|
|
|
|
|
|
|
LL | s.remove(&"b".to_owned());
|
|
|
|
| ^^^^^^^^^^^^^^^ help: replace it with: `"b"`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_string`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:566:14
|
2024-02-20 10:53:19 -06:00
|
|
|
|
|
|
|
|
LL | s.remove(&"b".to_string());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: replace it with: `"b"`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_vec`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:571:14
|
2024-02-20 10:53:19 -06:00
|
|
|
|
|
|
|
|
LL | s.remove(&["b"].to_vec());
|
|
|
|
| ^^^^^^^^^^^^^^^ help: replace it with: `["b"].as_slice()`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_vec`
|
2024-07-15 03:44:02 -05:00
|
|
|
--> tests/ui/unnecessary_to_owned.rs:572:14
|
2024-02-20 10:53:19 -06:00
|
|
|
|
|
|
|
|
LL | s.remove(&(&["b"]).to_vec());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `(&["b"]).as_slice()`
|
|
|
|
|
2024-06-19 17:09:31 -05:00
|
|
|
error: aborting due to 88 previous errors
|
2021-12-17 06:40:22 -06:00
|
|
|
|