Parcourir la source

Rename InvalidPackage error to MalformedPackage

This makes it more consistent with the MalformedBuffer error
Isaac Woods il y a 4 ans
Parent
commit
c5d66efcd0
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 1 1
      aml/src/lib.rs
  2. 1 1
      aml/src/type2.rs

+ 1 - 1
aml/src/lib.rs

@@ -620,7 +620,7 @@ pub enum AmlError {
     InvalidStringConstant,
     InvalidRegionSpace(u8),
     /// Produced when a `DefPackage` contains a different number of elements to the package's length.
-    InvalidPackage,
+    MalformedPackage,
     /// Produced when a `DefBuffer` contains more bytes that its size.
     MalformedBuffer,
     /// Emitted by a parser when it's clear that the stream doesn't encode the object parsed by

+ 1 - 1
aml/src/type2.rs

@@ -282,7 +282,7 @@ where
                     }
 
                     if package_contents.len() != num_elements as usize {
-                        return Err((input, context, AmlError::InvalidPackage));
+                        return Err((input, context, AmlError::MalformedPackage));
                     }
 
                     Ok((input, context, AmlValue::Package(package_contents)))