diff --git a/crates/cargo-util-schemas/src/manifest/mod.rs b/crates/cargo-util-schemas/src/manifest/mod.rs index 563b7d329..db0176b52 100644 --- a/crates/cargo-util-schemas/src/manifest/mod.rs +++ b/crates/cargo-util-schemas/src/manifest/mod.rs @@ -1496,7 +1496,7 @@ impl TomlPlatform { #[derive(Serialize, Debug, Clone)] #[cfg_attr(feature = "unstable-schema", derive(schemars::JsonSchema))] pub struct InheritableLints { - #[serde(skip_serializing_if = "is_false")] + #[serde(skip_serializing_if = "std::ops::Not::not")] #[cfg_attr(feature = "unstable-schema", schemars(default))] pub workspace: bool, #[serde(flatten)] @@ -1513,10 +1513,6 @@ impl InheritableLints { } } -fn is_false(b: &bool) -> bool { - !b -} - impl<'de> Deserialize<'de> for InheritableLints { fn deserialize(deserializer: D) -> Result where diff --git a/crates/crates-io/lib.rs b/crates/crates-io/lib.rs index ae7f9c4da..a208cf4e5 100644 --- a/crates/crates-io/lib.rs +++ b/crates/crates-io/lib.rs @@ -82,14 +82,10 @@ pub struct NewCrateDependency { pub artifact: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub bindep_target: Option, - #[serde(default, skip_serializing_if = "is_false")] + #[serde(default, skip_serializing_if = "std::ops::Not::not")] pub lib: bool, } -fn is_false(x: &bool) -> bool { - *x == false -} - #[derive(Deserialize)] pub struct User { pub id: u32,