Skip to content

Commit f3c4c78

Browse files
committed
Fix codestyle
1 parent a5a1baf commit f3c4c78

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/sdiff.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)