From e22582538707dee1414b5fa34dcc6cb5f527411a Mon Sep 17 00:00:00 2001 From: marcelbuesing Date: Tue, 3 Jul 2018 10:32:20 +0200 Subject: [PATCH] implement FromParam for bool --- src/param.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/param.rs b/src/param.rs index 649345ee0..77fc755ff 100644 --- a/src/param.rs +++ b/src/param.rs @@ -240,6 +240,7 @@ macro_rules! FROM_STR { }; } +FROM_STR!(bool); FROM_STR!(u8); FROM_STR!(u16); FROM_STR!(u32); @@ -296,4 +297,16 @@ mod tests { Ok(PathBuf::from_iter(vec!["seg2"])) ); } + + #[test] + fn test_from_param() { + assert_eq!( + ::from_param("true").unwrap(), + true + ); + assert_eq!( + ::from_param("false").unwrap(), + false + ); + } }