Remove public postcard re-exports

postcard serialization is only used internally and therefore is an
implementation detail that should not be part of the public API.  Crates
that also need postcard serialization should declare their own
dependency for that.
This commit is contained in:
Robin Krahl
2023-04-19 21:11:02 +02:00
parent dfbcb41d2e
commit c749b095ee
2 changed files with 6 additions and 3 deletions
+2
View File
@@ -34,6 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated `littlefs2` to 0.4.0.
- Made `Request`, `Reply`, `Error`, `Context`, `CoreContext`, `Mechanism`,
`ui::Status` non-exhaustive.
- Made `postcard_deserialize`, `postcard_serialize` and
`postcard_serialize_bytes` private.
### Fixed
+4 -3
View File
@@ -48,11 +48,12 @@ pub use error::Error;
pub use platform::Platform;
pub use service::Service;
pub use cbor_smol::{cbor_deserialize, cbor_serialize, cbor_serialize_bytes};
pub use cbor_smol::{cbor_deserialize, cbor_serialize_bytes};
pub use heapless_bytes::Bytes;
pub use postcard::{from_bytes as postcard_deserialize, to_slice as postcard_serialize};
pub fn postcard_serialize_bytes<T: serde::Serialize, const N: usize>(
pub(crate) use postcard::from_bytes as postcard_deserialize;
pub(crate) fn postcard_serialize_bytes<T: serde::Serialize, const N: usize>(
object: &T,
) -> postcard::Result<Bytes<N>> {
let vec = postcard::to_vec(object)?;