Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn parse_one(c: char, s: &str) -> Result<u8, &'static str> {
- match c {
- 'a' => Ok(0),
- 'b' => parse_many(s).map(|m1| parse_many(&s[1..]).map(|m2| 10)),
- _ => Err("Expected a or b"),
- }
- }
- fn parse_many(s: &str) -> Result<Vec<u8>, &'static str> {
- panic!()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement