From f6333a39a5f33d04a608e13124ea7908ed456e04 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 7 Jan 2022 10:18:21 +0000 Subject: [PATCH] acpi_tables: Fix clippy (unnecessary_to_owned) issues warning: unnecessary use of `to_vec` --> acpi_tables/src/aml.rs:1395:38 | 1395 | assert_eq!(create_pkg_length(&[0u8; 62].to_vec(), true), vec![63]); | ^^^^^^^^^^^^^^^^^^^ help: use: `[0u8; 62].as_ref()` | = note: `#[warn(clippy::unnecessary_to_owned)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned warning: unnecessary use of `to_vec` --> acpi_tables/src/aml.rs:1397:31 | 1397 | create_pkg_length(&[0u8; 64].to_vec(), true), | ^^^^^^^^^^^^^^^^^^^ help: use: `[0u8; 64].as_ref()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned warning: unnecessary use of `to_vec` --> acpi_tables/src/aml.rs:1401:31 | 1401 | create_pkg_length(&[0u8; 4096].to_vec(), true), | ^^^^^^^^^^^^^^^^^^^^^ help: use: `[0u8; 4096].as_ref()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned Signed-off-by: Rob Bradford --- acpi_tables/src/aml.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acpi_tables/src/aml.rs b/acpi_tables/src/aml.rs index 2c6ca7e79..1b6d6476f 100644 --- a/acpi_tables/src/aml.rs +++ b/acpi_tables/src/aml.rs @@ -1392,13 +1392,13 @@ mod tests { #[test] fn test_pkg_length() { - assert_eq!(create_pkg_length(&[0u8; 62].to_vec(), true), vec![63]); + assert_eq!(create_pkg_length(&[0u8; 62], true), vec![63]); assert_eq!( - create_pkg_length(&[0u8; 64].to_vec(), true), + create_pkg_length(&[0u8; 64], true), vec![1 << 6 | (66 & 0xf), 66 >> 4] ); assert_eq!( - create_pkg_length(&[0u8; 4096].to_vec(), true), + create_pkg_length(&[0u8; 4096], true), vec![ 2 << 6 | (4099 & 0xf) as u8, (4099 >> 4) as u8,