File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,10 +14,9 @@ fn s2y<T: ToString>(s: T) -> Yaml {
1414
1515fn parse_str < T : ToString > ( a : & Hash , k : T ) -> String {
1616 let s = a. get ( & s2y ( k) ) ;
17- if s. is_none ( ) {
18- "" . to_string ( )
19- } else {
20- s. unwrap ( ) . as_str ( ) . unwrap ( ) . to_string ( )
17+ match s {
18+ Some ( ele) => ele. as_str ( ) . unwrap ( ) . to_string ( ) ,
19+ None => "" . to_string ( ) ,
2120 }
2221}
2322
@@ -42,7 +41,7 @@ fn set_args(mut p: Manual, y: &Yaml) -> Manual {
4241 let arg = val. as_hash ( ) . unwrap ( ) ;
4342 if arg. get ( & s2y ( "index" ) ) . is_none ( ) {
4443 let takes_value = arg. get ( & s2y ( "takes_value" ) ) ;
45- if takes_value. is_none ( ) || takes_value. unwrap ( ) . as_bool ( ) . unwrap ( ) == false {
44+ if takes_value. is_none ( ) || ! takes_value. unwrap ( ) . as_bool ( ) . unwrap ( ) {
4645 let mut f = Flag :: new ( )
4746 . long ( parse_str ( & arg, "long" ) . as_str ( ) )
4847 . help ( parse_str ( & arg, "help" ) . as_str ( ) ) ;
You can’t perform that action at this time.
0 commit comments