Skip to content

Commit 09e1b9f

Browse files
committed
---
yaml --- r: 233911 b: refs/heads/beta c: 2a65474 h: refs/heads/master i: 233909: 556c02b 233907: d759e56 233903: b15069d v: v3
1 parent 652b9c6 commit 09e1b9f

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 0dbbab904916236d59446b9f51944a057e7b9966
26+
refs/heads/beta: 2a65474221f9b18fdf3b3309024bafc3c38e95fd
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/libfmt_macros/lib.rs

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl<'a> Parser<'a> {
190190
/// String, but I think it does when this eventually uses conditions so it
191191
/// might as well start using it now.
192192
fn err(&mut self, msg: &str) {
193-
self.errors.push(msg.to_string());
193+
self.errors.push(msg.to_owned());
194194
}
195195

196196
/// Optionally consumes the specified character. If the character is not at
@@ -353,7 +353,7 @@ impl<'a> Parser<'a> {
353353
} else {
354354
spec.ty = self.word();
355355
}
356-
return spec;
356+
spec
357357
}
358358

359359
/// Parses a Count parameter at the current position. This does not check
@@ -417,25 +417,19 @@ impl<'a> Parser<'a> {
417417
fn integer(&mut self) -> Option<usize> {
418418
let mut cur = 0;
419419
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
433427
}
434428
}
435429
if found {
436-
return Some(cur);
430+
Some(cur)
437431
} else {
438-
return None;
432+
None
439433
}
440434
}
441435
}

0 commit comments

Comments
 (0)