From 4488a6496a079ba081d7c8dce1ce50a394655f02 Mon Sep 17 00:00:00 2001 From: Trangar Date: Sun, 2 Mar 2025 16:59:41 +0100 Subject: [PATCH] Document making serde an optional dependency (#746) --- src/features/serde/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/features/serde/mod.rs b/src/features/serde/mod.rs index 353c0c4..0726c55 100644 --- a/src/features/serde/mod.rs +++ b/src/features/serde/mod.rs @@ -52,8 +52,19 @@ //! //! **Using any of the above attributes can and will cause issues with bincode and will result in lost data**. Consider using bincode's own derive macro instead. //! +//! # Why move away from serde? +//! +//! Serde is a great library, but it has some issues that makes us want to be decoupled from serde: +//! - The issues documented above with attributes. +//! - Serde has chosen to not have a MSRV ([source](https://github.com/serde-rs/serde/pull/2257)). We think MSRV is important, bincode 1 still compiles with rust 1.18. +//! - Before serde we had rustc-serializer. Serde has more than replaced rustc-serializer, but we can imagine a future where serde is replaced by something else. +//! - We believe that less dependencies is better, and that you should be able to choose your own dependencies. If you disable all features, bincode 2 only has 1 dependency. ([`unty`], a micro crate we manage ourselves) +//! +//! **note:** just because we're making serde an optional dependency, it does not mean we're dropping support for serde. Serde will still be fully supported, we're just giving you the option to not use it. +//! //! [Decode]: ../de/trait.Decode.html //! [Encode]: ../enc/trait.Encode.html +//! [`unty`]: https://crates.io/crates/unty mod de_borrowed; mod de_owned;