Przeglądaj źródła

Fix a bunch of warnings

Isaac Woods 5 lat temu
rodzic
commit
f277b97557

+ 4 - 4
aml_parser/src/lib.rs

@@ -118,7 +118,7 @@ impl AmlContext {
         let table_length = PkgLength::from_raw_length(stream, stream.len() as u32) as PkgLength;
         match term_object::term_list(table_length).parse(stream, self) {
             Ok(_) => Ok(()),
-            Err((remaining, _context, err)) => {
+            Err((_, _, err)) => {
                 error!("Failed to parse AML stream. Err = {:?}", err);
                 Err(err)
             }
@@ -146,9 +146,9 @@ impl AmlContext {
             let return_value =
                 match term_list(PkgLength::from_raw_length(&code, code.len() as u32)).parse(&code, self) {
                     // If the method doesn't return a value, we implicitly return `0`
-                    Ok((remaining, context, result)) => Ok(AmlValue::Integer(0)),
-                    Err((remaining, context, AmlError::Return(result))) => Ok(result),
-                    Err((remaining, context, err)) => {
+                    Ok(_) => Ok(AmlValue::Integer(0)),
+                    Err((_, _, AmlError::Return(result))) => Ok(result),
+                    Err((_, _, err)) => {
                         error!("Failed to execute control method: {:?}", err);
                         Err(err)
                     }

+ 4 - 4
aml_parser/src/term_object.rs

@@ -136,12 +136,12 @@ where
                 .map_with_context(|(length, name), context| {
                     let previous_scope = context.current_scope.clone();
                     context.current_scope = try_with_context!(context, name.resolve(&context.current_scope));
-                    (Ok((length, name, previous_scope)), context)
+                    (Ok((length, previous_scope)), context)
                 })
-                .feed(|(pkg_length, name, previous_scope)| {
-                    term_list(pkg_length).map(move |_| Ok((name.clone(), previous_scope.clone())))
+                .feed(|(pkg_length, previous_scope)| {
+                    term_list(pkg_length).map(move |_| Ok(previous_scope.clone()))
                 })
-                .map_with_context(|(name, previous_scope), context| {
+                .map_with_context(|previous_scope, context| {
                     context.current_scope = previous_scope;
                     (Ok(()), context)
                 }),

+ 1 - 1
aml_parser/src/type2.rs

@@ -123,7 +123,7 @@ where
                     match object.clone() {
                         AmlValue::Name(boxed_value) => (Ok(unbox(boxed_value)), context),
 
-                        AmlValue::Method { flags, ref code } => {
+                        AmlValue::Method { ref code, .. } => {
                             // TODO: before we do this, we need to restructure the structures to allow us
                             // to execute control methods from inside other control methods
                             // TODO

+ 1 - 1
aml_parser/src/value.rs

@@ -161,7 +161,7 @@ impl AmlValue {
         match self {
             AmlValue::Integer(value) => Ok(*value),
 
-            AmlValue::Buffer { size, ref bytes } => {
+            AmlValue::Buffer { ref bytes, .. } => {
                 /*
                  * "The first 8 bytes of the buffer are converted to an integer, taking the first
                  * byte as the least significant byte of the integer. A zero-length buffer is