From 1b314cff5b7fe3353690273b2d4128c56dfebb4c Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Mon, 12 Dec 2022 16:51:44 +0000 Subject: [PATCH] acpi_tables: sdt: Implement Std::is_empty() This allows the removal of [allow(clippy::len_without_is_empty)] Signed-off-by: Rob Bradford --- acpi_tables/src/sdt.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/acpi_tables/src/sdt.rs b/acpi_tables/src/sdt.rs index 7efbf95c3..a300a74f7 100644 --- a/acpi_tables/src/sdt.rs +++ b/acpi_tables/src/sdt.rs @@ -38,7 +38,6 @@ pub struct Sdt { data: Vec, } -#[allow(clippy::len_without_is_empty)] impl Sdt { pub fn new( signature: [u8; 4], @@ -124,6 +123,10 @@ impl Sdt { pub fn len(&self) -> usize { self.data.len() } + + pub fn is_empty(&self) -> bool { + self.data.is_empty() + } } #[cfg(test)]