diff options
author | Alex Crichton <alex@alexcrichton.com> | 2015-02-03 08:37:05 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-03 08:37:05 -0800 |
commit | 00420259044e9e961b9d8a80e5482ffc58250145 (patch) | |
tree | d6df5f34775ac8868c78a635e8e2a740d537d496 /src/parser.rs | |
parent | ff8924a971db93fb0687efd24b91368b62d7e286 (diff) | |
download | milf-rs-00420259044e9e961b9d8a80e5482ffc58250145.tar.gz milf-rs-00420259044e9e961b9d8a80e5482ffc58250145.zip |
Bump to 0.1.16
Diffstat (limited to 'src/parser.rs')
-rw-r--r-- | src/parser.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parser.rs b/src/parser.rs index 4316df3..723ac3a 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -132,7 +132,7 @@ impl<'a> Parser<'a> { // Consumes the rest of the line after a comment character fn comment(&mut self) -> bool { if !self.eat('#') { return false } - for (_, ch) in self.cur { + for (_, ch) in self.cur.by_ref() { if ch == '\n' { break } } true @@ -379,7 +379,7 @@ impl<'a> Parser<'a> { } else { "invalid" }; - match FromStrRadix::from_str_radix(num, 16) { + match FromStrRadix::from_str_radix(num, 16).ok() { Some(n) => { match char::from_u32(n) { Some(c) => { @@ -497,9 +497,9 @@ impl<'a> Parser<'a> { } else { let input = input.trim_left_matches('+'); if is_float { - input.parse().map(Float) + input.parse().ok().map(Float) } else { - input.parse().map(Integer) + input.parse().ok().map(Integer) } }; if ret.is_none() { |