martinohmann / hcl-rs

HCL parsing and encoding libraries for rust with serde support
Apache License 2.0
119 stars 14 forks source link

fix(parser): switch from `&[u8]` to `&str` based stream #351

Closed martinohmann closed 1 month ago

martinohmann commented 1 month ago

Fixes https://github.com/martinohmann/hcl-rs/issues/350

This fixes an unsoundness around handling of UTF-8 identifiers in the parser at the expense of decreasing the performance by around 20-30%.

I may switch back to a &[u8] based stream once I figured out how to handle UTF-8 identifiers with it safely without adding a truck load of complexity, but for now correctness is more important than performance.