duesee / abnf

A nom-based ABNF parser.
Apache License 2.0
17 stars 3 forks source link

Parsers should consume UTF-8 strings (`&str`), not bytes (`&[u8]`) #10

Closed duesee closed 5 years ago

duesee commented 5 years ago

With &str we can use nom's VerboseError to report on syntax errors.

Although &[u8] is fine, the RFC works with ASCII and we already need to convert from &[u8] to &str in some places. Using &str slightly simplifies the code and generally seems more appropriate.

duesee commented 5 years ago

Changed with 0896e1fbbbb41a29bbd8bac6d451826437cefa5f.