diff options
author | Justin Wernick <justin@worthe-it.co.za> | 2021-12-01 08:44:23 +0200 |
---|---|---|
committer | Justin Wernick <justin@worthe-it.co.za> | 2021-12-01 08:44:23 +0200 |
commit | 18bdad10c27d199a4085655ce93902d4bba0d534 (patch) | |
tree | 1cce82983b84a80b8b269fdaee88adbb90f2bee2 /src/parsers.rs |
Day 1
Diffstat (limited to 'src/parsers.rs')
-rw-r--r-- | src/parsers.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/parsers.rs b/src/parsers.rs new file mode 100644 index 0000000..27b2aad --- /dev/null +++ b/src/parsers.rs @@ -0,0 +1,6 @@ +use nom::{character::complete::digit1, combinator::map_res, IResult}; +use std::str::FromStr; + +pub fn u64(input: &str) -> IResult<&str, u64> { + map_res(digit1, |number| u64::from_str(number))(input) +} |