Created
November 14, 2017 16:15
-
-
Save rschulman/8d5baf69ca8a3f2faa43c369df0bef66 to your computer and use it in GitHub Desktop.
Not working nom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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