From 5902ceb955a38e155daf6bd361d01f60bfd77f70 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 3 Nov 2021 14:29:05 +0000 Subject: [PATCH] acpi_tables: aml: Implement Aml::append_aml_bytes() for Name This is a naive implementation and there is scope to improve this without extra copies but that requires addressing the users to ensure there are no lifetime issues. Signed-off-by: Rob Bradford --- acpi_tables/src/aml.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/acpi_tables/src/aml.rs b/acpi_tables/src/aml.rs index cf93fb30b..b573f11f1 100644 --- a/acpi_tables/src/aml.rs +++ b/acpi_tables/src/aml.rs @@ -136,8 +136,10 @@ pub struct Name { } impl Aml for Name { - fn to_aml_bytes(&self) -> Vec { - self.bytes.clone() + fn append_aml_bytes(&self, bytes: &mut Vec) { + // TODO: Refactor this to make more efficient but there are + // lifetime/ownership challenges. + bytes.append(&mut self.bytes.clone()) } }