Skip to content

Commit 0c9923f

Browse files
committed
chore(deps): Depend on serde_core in cargo-platform
`cargo-platform` 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.
1 parent ee515e6 commit 0c9923f

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

Cargo.lock

Lines changed: 15 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ same-file = "1.0.6"
8989
schemars = "1.0.4"
9090
security-framework = "3.3.0"
9191
semver = { version = "1.0.26", features = ["serde"] }
92-
serde = "1.0.219"
92+
serde = "1.0.220"
93+
serde_core = "1.0.220"
9394
serde-untagged = "0.1.7"
9495
serde-value = "0.7.0"
9596
serde_ignored = "0.1.12"

crates/cargo-platform/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ documentation = "https://docs.rs/cargo-platform"
1010
description = "Cargo's representation of a target platform."
1111

1212
[dependencies]
13+
serde_core.workspace = true
14+
15+
[target.'cfg(any())'.dependencies]
1316
serde.workspace = true
1417

1518
[lints]

crates/cargo-platform/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,22 +140,22 @@ impl Platform {
140140
}
141141
}
142142

143-
impl serde::Serialize for Platform {
143+
impl serde_core::Serialize for Platform {
144144
fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
145145
where
146-
S: serde::Serializer,
146+
S: serde_core::Serializer,
147147
{
148148
self.to_string().serialize(s)
149149
}
150150
}
151151

152-
impl<'de> serde::Deserialize<'de> for Platform {
152+
impl<'de> serde_core::Deserialize<'de> for Platform {
153153
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
154154
where
155-
D: serde::Deserializer<'de>,
155+
D: serde_core::Deserializer<'de>,
156156
{
157157
let s = String::deserialize(deserializer)?;
158-
FromStr::from_str(&s).map_err(serde::de::Error::custom)
158+
FromStr::from_str(&s).map_err(serde_core::de::Error::custom)
159159
}
160160
}
161161

0 commit comments

Comments
 (0)