File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ pub fn parse_params<I: Iterator<Item = OsString>>(mut opts: Peekable<I>) -> Resu
5252 let tabsize_re = Regex :: new ( r"^--tabsize=(?<num>\d+)$" ) . unwrap ( ) ;
5353 let width_re = Regex :: new ( r"--width=(?P<long>\d+)$" ) . unwrap ( ) ;
5454
55- while let Some ( param) = opts. next ( ) {
55+ for param in opts. by_ref ( ) {
5656 if param == "-" {
5757 if from. is_none ( ) {
5858 from = Some ( param) ;
@@ -135,15 +135,21 @@ pub fn parse_params<I: Iterator<Item = OsString>>(mut opts: Peekable<I>) -> Resu
135135 } else if let Some ( param) = opts. next ( ) {
136136 param
137137 } else {
138- return Err ( format ! ( "Err" ) ) ;
138+ return Err ( format ! (
139+ "Usage: {} <from> <to>" ,
140+ params. executable. to_string_lossy( )
141+ ) ) ;
139142 } ;
140143
141144 params. to = if let Some ( to) = to {
142145 to
143146 } else if let Some ( param) = opts. next ( ) {
144147 param
145148 } else {
146- return Err ( format ! ( "Err" ) ) ;
149+ return Err ( format ! (
150+ "Usage: {} <from> <to>" ,
151+ params. executable. to_string_lossy( )
152+ ) ) ;
147153 } ;
148154
149155 Ok ( params)
You can’t perform that action at this time.
0 commit comments