From d9c1ef482bf4e397ae9e6393490c24cbe61be79d Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 25 Jan 2017 18:36:59 +0100 Subject: [PATCH 1/2] Allow dead code in test code --- libimagerror/src/error_gen.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libimagerror/src/error_gen.rs b/libimagerror/src/error_gen.rs index e46ce184..4f4d6c7e 100644 --- a/libimagerror/src/error_gen.rs +++ b/libimagerror/src/error_gen.rs @@ -242,11 +242,15 @@ mod test { generate_error_imports!(); + #[allow(dead_code)] generate_custom_error_types!(CustomTestError, CustomTestErrorKind, CustomData, CustomErrorKindA => "customerrorkind a", CustomErrorKindB => "customerrorkind B"); + // Allow dead code here. + // We wrote this to show that custom test types can be implemented. + #[allow(dead_code)] impl CustomTestError { pub fn test(&self) -> i32 { match self.custom_data { From e0e6e0c1174cd15f69a2b4396daadf565cd7a601 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 25 Jan 2017 18:37:05 +0100 Subject: [PATCH 2/2] Remove unused variable --- libimagerror/src/error_gen.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libimagerror/src/error_gen.rs b/libimagerror/src/error_gen.rs index 4f4d6c7e..38cb1590 100644 --- a/libimagerror/src/error_gen.rs +++ b/libimagerror/src/error_gen.rs @@ -416,7 +416,7 @@ mod test { let something : Option = None; match something.ok_or_errkind(TestErrorKind::TestErrorKindA) { Ok(_) => assert!(false), - Err(e) => assert!(true), + Err(_) => assert!(true), } }