Everything I try gives me Incomplete(Size(1))
. My best guess right now is:
named!(my_u64(&str) -> u64,
map_res!(recognize!(nom::digit), u64::from_str)
);
Test:
#[cfg(test)]
mod test {
#[test]
fn my_u64() {
assert_eq!(Ok(("", 0)), super::my_u64("0"));
}
}
Sometimes in my variations (e.g. adding complete!
) I've been able to get it to parse if I add a character onto the end.
I'd like to get a working parse for this (ultimately my hope is that this will allow me to create a parser for a u64
wrapper type) but bigger picture I'd like to get a grasp of how to build a parser properly myself.