diff options
author | Justin Wernick <justin@worthe-it.co.za> | 2021-12-01 19:56:40 +0200 |
---|---|---|
committer | Justin Wernick <justin@worthe-it.co.za> | 2021-12-01 19:56:40 +0200 |
commit | e132e55fee2822f6eeb1e47a69491e69b22bb41f (patch) | |
tree | 96f966bc779f0a7feb4711a952439f0ce1100a3e | |
parent | 363ea1a0243c137b2480c421404e5124770ed09b (diff) |
Extra parsers that may come up
-rw-r--r-- | src/parsers.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/parsers.rs b/src/parsers.rs index c33a3cc..7e8ecc9 100644 --- a/src/parsers.rs +++ b/src/parsers.rs @@ -4,3 +4,15 @@ use std::str::FromStr; pub fn u64(input: &str) -> IResult<&str, u64> { map_res(digit1, u64::from_str)(input) } + +pub fn i64(input: &str) -> IResult<&str, i64> { + map_res(digit1, i64::from_str)(input) +} + +pub fn u32(input: &str) -> IResult<&str, u32> { + map_res(digit1, u32::from_str)(input) +} + +pub fn i32(input: &str) -> IResult<&str, i32> { + map_res(digit1, i32::from_str)(input) +} |