zaari / nmea-parser

Rust NMEA 0183 sentence parser for AIS and GNSS messages.
Apache License 2.0
40 stars 25 forks source link

pick_number and pick_string tweaks #5

Closed wezm closed 4 years ago

wezm commented 4 years ago

Small simplification to pick_number and pick_string. Avoid allocating one string in pick_string.

wezm commented 4 years ago

I added panic! to replace the assert! that was in the previous code. The behaviour is unchanged.

zaari commented 4 years ago

Actually your code is ok. Only a bug in pick_u64 would make the panic happen as all the 6-bit cases are covered.