Skip to content

Commit 579784e

Browse files
committed
Depend on serde_core instead of serde
This crate does not make use of serde derive macros, thus it can depend on `serde_core` instead of `serde` to speed up users' compile times. See the documentation of [`serde_core`](https://docs.rs/serde_core) for more details. Note that this adds a hidden `serde_core` feature, since we cannot use the `dep:` syntax when declaring the `serde` feature due to this crate's MSRV being lower than [the required 1.60](https://blog.rust-lang.org/2022/04/07/Rust-1.60.0/#new-syntax-for-cargo-features).
1 parent 4b53a29 commit 579784e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ categories = ["network-programming", "data-structures"]
2121
[features]
2222
default = ["std"]
2323
std = []
24+
serde = ["serde_core"]
2425

2526
[dependencies]
26-
serde = { version = "1.0.60", optional = true, default-features = false, features = ["alloc"] }
27+
serde_core = { version = "1.0.221", optional = true, default-features = false, features = ["alloc"] }
2728
# Use portable-atomic crate to support platforms without atomic CAS.
2829
# See "no_std support" section in readme for more information.
2930
#

src/serde.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use super::{Bytes, BytesMut};
22
use alloc::string::String;
33
use alloc::vec::Vec;
44
use core::{cmp, fmt};
5-
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
5+
use serde_core::{de, Deserialize, Deserializer, Serialize, Serializer};
66

77
macro_rules! serde_impl {
88
($ty:ident, $visitor_ty:ident, $from_slice:ident, $from_vec:ident) => {

0 commit comments

Comments
 (0)