tokio-rs / prost

PROST! a Protocol Buffers implementation for the Rust Language
Apache License 2.0
3.86k stars 500 forks source link

chore: improve `no_std` maintainability: #1047

Open gibbz00 opened 5 months ago

gibbz00 commented 5 months ago

Similar to how rustls does it:

https://github.com/rustls/rustls/blob/513e374b2e2ce9f1fb57ac78ab3ca053afc8f133/rustls/src/lib.rs#L353-L359

... extern crate plus the #![no_std] attribute changes the default prelude from std::prelude to core::prelude. That forces one to explicitly import (use) everything that is in std::prelude but not in core::prelude. This helps maintain no-std support as even developers that are not interested in, or aware of, no-std support and / or that never run cargo build --no-default-features locally will get errors when they rely on std::prelude API.