This commit is contained in:
nora 2023-12-03 12:16:33 +01:00
parent a039fddf85
commit d95881c5cf
5 changed files with 13 additions and 8 deletions

View file

@ -6,3 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
nom.workspace = true

View file

@ -0,0 +1,5 @@
use nom::{character::complete::digit1, combinator::map, IResult};
pub fn integer(input: &str) -> IResult<&str, u64> {
map(digit1, |d: &str| d.parse::<u64>().unwrap())(input)
}