niax / rust-email

Implementation of MIME Messages for Rust
MIT License
62 stars 34 forks source link

Remove panics #20

Closed buster closed 9 years ago

buster commented 9 years ago

Hi,

my program used MimeMessage::parse() which returns a ParseResult. But it paniced on certain garbage strings, which i would absolutely want to avoid (mails are usually externally delivered into the mail parser, and shouldn't just crash the program!). Could you please check if this is good for you?

Also, did you consider rust-peg as parser generator? I've had very good experiences with it and some RFC based parsing, because you can take the RFC syntax notation and derive the PEG syntax easily.. Just a hint :)

untitaker commented 9 years ago

rust-peg is much slower and isn't ready for rust-stable, both of which are a dealbreaker. I've rewritten a parser of mine to not use rust-peg because of this.

Thanks for this patch, it looks fine.