Skip to content

Instantly share code, notes, and snippets.

@rschulman
Created November 14, 2017 16:15
Show Gist options
  • Save rschulman/8d5baf69ca8a3f2faa43c369df0bef66 to your computer and use it in GitHub Desktop.
Save rschulman/8d5baf69ca8a3f2faa43c369df0bef66 to your computer and use it in GitHub Desktop.
Not working nom
named!(date<&str, Date>, do_parse!(
y: digit() >>
tag_s!("-") >>
m: digit() >>
tag_s!("-") >>
d: digit() >>
eof!() >>
(Date {
year: from_str::<u16>(y),
month: from_str::<u8>(m),
day: from_str::<u8>(d),
})
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment