YoloDev / hass-rs

4 stars 1 forks source link

mqtt-proto does not build in a no_std environment #100

Open nitroxis opened 6 months ago

nitroxis commented 6 months ago

Hi, I found your project while looking for home assistant MQTT serde types and it seems like mqtt-proto has them. The crate itself has no_std support, however, one of its dependencies, nameof, does not:

error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv6m-none-eabi` target may not support the standard library
  = note: `std` is required by `nameof` because it does not declare `#![no_std]`
  = help: consider building the standard library from source with `cargo build -Zbuild-std`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `nameof` (lib) due to 1 previous error

As far as I can tell, the dependency on this crate could be removed quite easily. Would be cool to allow this crate to be used on embedded devices.

Alxandr commented 6 months ago

It's a really nice QoL create though. While I could definitely inline the macros, I would be rather shocked if nameof requires std. Have you made an issue over there asking if it could be made no_std?

nitroxis commented 6 months ago

I have created an issue: https://github.com/SilentByte/nameof/issues/12