AeroRust / nmea

NMEA 0183 - for communication between marine electronics such as echo sounder, sonars, anemometer, gyrocompass, autopilot, GNSS receivers and many other types of instruments. Defined and controlled by the National Marine Electronics Association (NMEA)
https://crates.io/crates/nmea
Other
56 stars 41 forks source link

#derive[Serialize] for chrono::NaiveTime uses collect_str which cannot be used in no_std #105

Closed 0xf4lc0n closed 1 year ago

0xf4lc0n commented 1 year ago

In GGA sentence there is NaiveTime https://github.com/AeroRust/nmea/blob/c7ba32e0154633ff90f3a3f5b2fe0cf19cf7ec7f/src/sentences/gga.rs#L35 NaiveTime internally uses collect_str for serialization which involves allocation so it can't be used in no_std environments.

As a remedy we can provide manual implementation of Serialize trait when no_std feature is selected.