From a115d214955fc27b317b8749bade24dee7aa39ca Mon Sep 17 00:00:00 2001 From: Connor Wood Date: Mon, 24 Jul 2017 19:02:09 +0100 Subject: [PATCH] Converted all types to string --- src/acpi/aml/namespace.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/acpi/aml/namespace.rs b/src/acpi/aml/namespace.rs index 78beb9c..7dbf2d4 100644 --- a/src/acpi/aml/namespace.rs +++ b/src/acpi/aml/namespace.rs @@ -304,6 +304,13 @@ impl AmlValue { pub fn get_as_string(&self) -> Result { match *self { AmlValue::String(ref s) => Ok(s.clone()), + AmlValue::Integer(ref i) => Ok(format!("{:X}", i)), + AmlValue::IntegerConstant(ref i) => Ok(format!("{:X}", i)), + AmlValue::Buffer(ref b) => Ok(String::from_utf8(b.clone()).expect("Invalid UTF-8")), + AmlValue::BufferField(_) => { + let b = self.get_as_buffer()?; + Ok(String::from_utf8(b).expect("Invalid UTF-8")) + }, _ => Err(AmlError::AmlValueError) } }