Skip to content

Commit 9c383de

Browse files
committed
fmt: simplify parse_count
1 parent f4bc9e6 commit 9c383de

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/libcore/extfmt.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ pub mod ct {
264264
}
265265
pub fn parse_count(s: &str, i: uint, lim: uint)
266266
-> Parsed<Count> {
267-
return if i >= lim {
267+
if i >= lim {
268268
Parsed::new(CountImplied, i)
269269
} else if s[i] == '*' as u8 {
270270
let param = parse_parameter(s, i + 1, lim);
@@ -274,15 +274,14 @@ pub mod ct {
274274
Some(n) => Parsed::new(CountIsParam(n), j)
275275
}
276276
} else {
277-
let num = peek_num(s, i, lim);
278-
match num {
277+
match peek_num(s, i, lim) {
279278
None => Parsed::new(CountImplied, i),
280279
Some(num) => Parsed::new(
281280
CountIs(num.val),
282281
num.next
283282
)
284283
}
285-
};
284+
}
286285
}
287286
pub fn parse_precision(s: &str, i: uint, lim: uint) ->
288287
Parsed<Count> {

0 commit comments

Comments
 (0)