Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. fn parse_one(c: char, s: &str) -> Result<u8, &'static str> {
  2. match c {
  3. 'a' => Ok(0),
  4. 'b' => parse_many(s).map(|m1| parse_many(&s[1..]).map(|m2| 10)),
  5. _ => Err("Expected a or b"),
  6. }
  7. }
  8.  
  9. fn parse_many(s: &str) -> Result<Vec<u8>, &'static str> {
  10. panic!()
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement