Skip to content

Commit 4550cb0

Browse files
committed
fmt: simplify parse_precision
1 parent 9c383de commit 4550cb0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/libcore/extfmt.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,7 @@ pub mod ct {
285285
}
286286
pub fn parse_precision(s: &str, i: uint, lim: uint) ->
287287
Parsed<Count> {
288-
return if i >= lim {
289-
Parsed::new(CountImplied, i)
290-
} else if s[i] == '.' as u8 {
288+
if i < lim && s[i] == '.' as u8 {
291289
let count = parse_count(s, i + 1u, lim);
292290
293291
@@ -297,7 +295,7 @@ pub mod ct {
297295
CountImplied => Parsed::new(CountIs(0), count.next),
298296
_ => count
299297
}
300-
} else { Parsed::new(CountImplied, i) };
298+
} else { Parsed::new(CountImplied, i) }
301299
}
302300
pub fn parse_type(s: &str, i: uint, lim: uint, err: ErrorFn) ->
303301
Parsed<Ty> {

0 commit comments

Comments
 (0)