@@ -525,11 +525,11 @@ impl CommandOptions {
525525 I : Iterator < Item = T > ,
526526 T : Into < OsString > + Clone ,
527527 {
528- let arg = if let Some ( arg) = args . next ( ) {
528+ let arg = match args . next ( ) { Some ( arg) => {
529529 arg. into ( )
530- } else {
530+ } _ => {
531531 return Ok ( None ) ;
532- } ;
532+ } } ;
533533
534534 // TODO expand response files, which have form `@path`.
535535 // Response files content is treated as regular command line parameters.
@@ -571,18 +571,18 @@ impl CommandOptions {
571571 // Separate takes value from next argument.
572572 OptionKind :: Separate => {
573573 if definition. matches_exact ( & arg) {
574- if let Some ( value) = args . next ( ) {
574+ match args . next ( ) { Some ( value) => {
575575 let value = value. into ( ) ;
576576
577577 return Ok ( Some ( ParsedArgument :: SingleValue (
578578 definition. clone ( ) ,
579579 value,
580580 ) ) ) ;
581- } else {
581+ } _ => {
582582 return Err ( Error :: ParseNoArgumentValue (
583583 definition. option_name . clone ( ) ,
584584 ) ) ;
585- }
585+ } }
586586 }
587587 }
588588 // Takes form `-name value` or `-namevalue`. e.g. `-l`.
@@ -591,18 +591,18 @@ impl CommandOptions {
591591 // Empty remaining means we consumed the full argument and the
592592 // value is the next argument.
593593 if remaining. is_empty ( ) {
594- if let Some ( value) = args . next ( ) {
594+ match args . next ( ) { Some ( value) => {
595595 let value = value. into ( ) ;
596596
597597 return Ok ( Some ( ParsedArgument :: SingleValue (
598598 definition. clone ( ) ,
599599 value,
600600 ) ) ) ;
601- } else {
601+ } _ => {
602602 return Err ( Error :: ParseNoArgumentValue (
603603 definition. option_name . clone ( ) ,
604604 ) ) ;
605- }
605+ } }
606606 } else {
607607 return Ok ( Some ( ParsedArgument :: SingleValue (
608608 definition. clone ( ) ,
@@ -615,19 +615,19 @@ impl CommandOptions {
615615 // Takes form `-name=<key> value`.
616616 OptionKind :: JoinedAndSeparate => {
617617 if let Some ( remaining) = definition. matches_prefix ( & arg) {
618- if let Some ( value) = args . next ( ) {
618+ match args . next ( ) { Some ( value) => {
619619 let value = value. into ( ) ;
620620
621621 return Ok ( Some ( ParsedArgument :: SingleValueKeyed (
622622 definition. clone ( ) ,
623623 remaining. to_os_string ( ) ,
624624 value,
625625 ) ) ) ;
626- } else {
626+ } _ => {
627627 return Err ( Error :: ParseNoArgumentValue (
628628 definition. option_name . clone ( ) ,
629629 ) ) ;
630- }
630+ } }
631631 }
632632 }
633633
@@ -804,17 +804,17 @@ impl ParsedArguments {
804804 . map ( |arg| {
805805 if let Some ( option) = arg. option ( ) {
806806 if let Some ( alias) = & option. alias {
807- if let Some ( canonical ) = options
807+ match options
808808 . iter_options ( )
809809 . find ( |candidate| & candidate. option_name == alias)
810- {
810+ { Some ( canonical ) => {
811811 Ok ( arg. with_option ( canonical. clone ( ) ) )
812- } else {
812+ } _ => {
813813 Err ( Error :: AliasMissing (
814814 option. option_name . clone ( ) ,
815815 alias. to_string ( ) ,
816816 ) )
817- }
817+ } }
818818 } else {
819819 Ok ( arg)
820820 }
0 commit comments