From e3e2dcb5a2e423fd63521e308a11f5386f1fe4ef Mon Sep 17 00:00:00 2001 From: Narfinger Date: Thu, 25 Sep 2025 17:54:21 +0200 Subject: [PATCH] Allow hyper_serde to only depend on serde_core for potentially faster compile times. (#39467) Serde_core was released which has all the traits and allows some crates to have parallel compile times. More information can be found here: https://github.com/serde-rs/serde/tree/master/serde_core serde_bytes already depends on on serde_core. Additionally added serde and serde_core to dependabot group. Signed-off-by: Narfinger Testing: Compilation is the test. --------- Signed-off-by: Narfinger --- .github/dependabot.yml | 4 ++++ Cargo.lock | 1 + Cargo.toml | 1 + components/hyper_serde/Cargo.toml | 3 ++- components/hyper_serde/lib.rs | 8 ++++---- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 47d00814c9c..d59c6f985f3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -38,6 +38,10 @@ updates: objc2-related: patterns: - "objc2*" + serde-related: + patterns: + - "serde" + - "serde_core" servo-media-related: patterns: - "servo-media*" diff --git a/Cargo.lock b/Cargo.lock index 2da98bf5e3f..c1515da1875 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4051,6 +4051,7 @@ dependencies = [ "mime", "serde", "serde_bytes", + "serde_core", "serde_test", ] diff --git a/Cargo.toml b/Cargo.toml index eec2e53f3d0..d7ad0ba0bcd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -130,6 +130,7 @@ script_traits = { path = "components/shared/script" } selectors = { git = "https://github.com/servo/stylo", branch = "2025-09-02" } serde = "1.0.226" serde_bytes = "0.11" +serde_core = "1.0.226" serde_json = "1.0" servo-media = { git = "https://github.com/servo/media" } servo-media-dummy = { git = "https://github.com/servo/media" } diff --git a/components/hyper_serde/Cargo.toml b/components/hyper_serde/Cargo.toml index 5e960e26344..f55babb1386 100644 --- a/components/hyper_serde/Cargo.toml +++ b/components/hyper_serde/Cargo.toml @@ -21,8 +21,9 @@ headers = { workspace = true } http = { workspace = true } hyper = { workspace = true } mime = { workspace = true } -serde = { workspace = true } serde_bytes = { workspace = true } +serde_core = { workspace = true } [dev-dependencies] +serde = { workspace = true } serde_test = "1.0" diff --git a/components/hyper_serde/lib.rs b/components/hyper_serde/lib.rs index fc786035b54..f5c3d3d8583 100644 --- a/components/hyper_serde/lib.rs +++ b/components/hyper_serde/lib.rs @@ -73,10 +73,10 @@ use http::HeaderMap; use hyper::header::{HeaderName, HeaderValue}; use hyper::{Method, StatusCode, Uri}; use mime::Mime; -use serde::de::{self, Error, MapAccess, SeqAccess, Visitor}; -use serde::ser::{SerializeMap, SerializeSeq}; -use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde_bytes::{ByteBuf, Bytes}; +use serde_core::de::{self, Error, MapAccess, SeqAccess, Visitor}; +use serde_core::ser::{SerializeMap, SerializeSeq}; +use serde_core::{Deserialize, Deserializer, Serialize, Serializer}; /// Deserialises a `T` value with a given deserializer. /// @@ -164,7 +164,7 @@ pub struct Ser<'a, T: 'a> { impl<'a, T> Ser<'a, T> where - Ser<'a, T>: serde::Serialize, + Ser<'a, T>: serde_core::Serialize, { /// Returns a new `Ser` wrapper. #[inline(always)]