Merge pull request #874 from matthiasbeyer/libimagerror/fix-warnings

Libimagerror/fix warnings
This commit is contained in:
Matthias Beyer 2017-01-25 19:36:59 +01:00 committed by GitHub
commit 71e1a4cd61

View file

@ -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 {
@ -412,7 +416,7 @@ mod test {
let something : Option<i32> = None;
match something.ok_or_errkind(TestErrorKind::TestErrorKindA) {
Ok(_) => assert!(false),
Err(e) => assert!(true),
Err(_) => assert!(true),
}
}