Skip to content

Commit 49fceec

Browse files
authored
Merge pull request #1 from maur1th/master
Update to use Rust 1.34, rustfmt
2 parents 0b352f1 + 611c8f7 commit 49fceec

File tree

6 files changed

+332
-252
lines changed

6 files changed

+332
-252
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
authors = ["eV <[email protected]>"]
33
name = "molysite"
44
version = "0.1.0"
5+
edition = "2018"
56

6-
[dependencies.nom]
7-
features = ["nightly"]
8-
version = "^3.2"
7+
[dependencies]
8+
nom = "^3.2"

src/common.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ named!(pub boolean<bool>,
1111
)
1212
);
1313

14-
named!(unsigned_float, recognize!(alt_complete!(
15-
delimited!(digit, tag!("."), opt!(complete!(digit))) |
16-
delimited!(opt!(digit), tag!("."), digit) |
17-
digit
18-
)));
14+
named!(
15+
unsigned_float,
16+
recognize!(alt_complete!(
17+
delimited!(digit, tag!("."), opt!(complete!(digit)))
18+
| delimited!(opt!(digit), tag!("."), digit)
19+
| digit
20+
))
21+
);
1922

2023
named!(pub float<f32>, map_res!(
2124
map_res!(
@@ -32,8 +35,8 @@ named!(pub float<f32>, map_res!(
3235
FromStr::from_str
3336
));
3437

35-
fn to_i(i: &str) -> Result<u32, ParseIntError> {
36-
u32::from_str_radix(i, 16)
38+
fn to_i(i: &str) -> Result<u32, ParseIntError> {
39+
u32::from_str_radix(i, 16)
3740
}
3841

3942
named!(pub int<u32>, map_res!(
@@ -43,7 +46,7 @@ named!(pub int<u32>, map_res!(
4346
),
4447
to_i
4548
));
46-
49+
4750
// TODO: add support for octal
4851
named!(pub number<f32>, alt_complete!(
4952
map!(int, |i| { i as f32 }) |

0 commit comments

Comments
 (0)