neoeinstein / protoc-gen-prost

Apache License 2.0
150 stars 42 forks source link

protoc-gen-prost-serde: `no_std` support #102

Open tony-iqlusion opened 2 months ago

tony-iqlusion commented 2 months ago

Would it be possible to add an option for the generated code to avoid referencing std and things that are only in the prelude when std is linked, e.g. std::result::Result and ToString, and instead use core::result::Result and alloc::string::ToString?

neoeinstein commented 2 months ago

Unfortunately the code generated for protoc-gen-prost-serde comes via the pbjson crate. They would need to provide a release that generates no_std compliant code. We could do some post-processing of their generated code, but that would be a potentially brittle transformation, so it would be better if the upstream could do this.

tony-iqlusion commented 2 months ago

Thanks! I opened an issue on pbjson: https://github.com/influxdata/pbjson/issues/135