m4rw3r / chomp

A fast monadic-style parser combinator designed to work on stable Rust.
Apache License 2.0
243 stars 19 forks source link

Question: What is the idiomatic way of parsing a string from a byte slice? #68

Open kjvalencik opened 7 years ago

kjvalencik commented 7 years ago

In other words, is there a concise way to map an arbitrary Result to a chomp error?

In nom, I would do the following:

map_res!(
    take_until_and_consume!("\n"),
    str::from_utf8
)

How would I do that with chomp?