File tree Expand file tree Collapse file tree 2 files changed +12
-18
lines changed
branches/try/src/libfmt_macros Expand file tree Collapse file tree 2 files changed +12
-18
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
3
3
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4
- refs/heads/try: 0dbbab904916236d59446b9f51944a057e7b9966
4
+ refs/heads/try: 2a65474221f9b18fdf3b3309024bafc3c38e95fd
5
5
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
6
6
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
7
7
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ impl<'a> Parser<'a> {
190
190
/// String, but I think it does when this eventually uses conditions so it
191
191
/// might as well start using it now.
192
192
fn err ( & mut self , msg : & str ) {
193
- self . errors . push ( msg. to_string ( ) ) ;
193
+ self . errors . push ( msg. to_owned ( ) ) ;
194
194
}
195
195
196
196
/// Optionally consumes the specified character. If the character is not at
@@ -353,7 +353,7 @@ impl<'a> Parser<'a> {
353
353
} else {
354
354
spec. ty = self . word ( ) ;
355
355
}
356
- return spec;
356
+ spec
357
357
}
358
358
359
359
/// Parses a Count parameter at the current position. This does not check
@@ -417,25 +417,19 @@ impl<'a> Parser<'a> {
417
417
fn integer ( & mut self ) -> Option < usize > {
418
418
let mut cur = 0 ;
419
419
let mut found = false ;
420
- loop {
421
- match self . cur . clone ( ) . next ( ) {
422
- Some ( ( _, c) ) => {
423
- match c. to_digit ( 10 ) {
424
- Some ( i) => {
425
- cur = cur * 10 + i as usize ;
426
- found = true ;
427
- self . cur . next ( ) ;
428
- }
429
- None => { break }
430
- }
431
- }
432
- None => { break }
420
+ while let Some ( ( _, c) ) = self . cur . clone ( ) . next ( ) {
421
+ if let Some ( i) = c. to_digit ( 10 ) {
422
+ cur = cur * 10 + i as usize ;
423
+ found = true ;
424
+ self . cur . next ( ) ;
425
+ } else {
426
+ break
433
427
}
434
428
}
435
429
if found {
436
- return Some ( cur) ;
430
+ Some ( cur)
437
431
} else {
438
- return None ;
432
+ None
439
433
}
440
434
}
441
435
}
You can’t perform that action at this time.
0 commit comments