소스 검색

Tidy up Debug implementation of MethodCode

Isaac Woods 4 년 전
부모
커밋
c7ba997bd1
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      aml/src/value.rs

+ 2 - 2
aml/src/value.rs

@@ -160,8 +160,8 @@ pub enum MethodCode {
 impl fmt::Debug for MethodCode {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self {
-            MethodCode::Aml(ref code) => f.debug_struct("AML method").field("code", code).finish(),
-            MethodCode::Native(_) => f.debug_struct("Native method").finish(),
+            MethodCode::Aml(ref code) => write!(f, "AML({:x?})", code),
+            MethodCode::Native(_) => write!(f, "(native method)"),
         }
     }
 }