diff --git a/crates/cargo-util-schemas/src/manifest/mod.rs b/crates/cargo-util-schemas/src/manifest/mod.rs index 2aafcb4bc2a..92dd3e88d08 100644 --- a/crates/cargo-util-schemas/src/manifest/mod.rs +++ b/crates/cargo-util-schemas/src/manifest/mod.rs @@ -351,6 +351,10 @@ impl InheritableField { InheritableField::Value(defined) => Some(defined), } } + + pub fn is_inherited(&self) -> bool { + matches!(self, Self::Inherit(_)) + } } //. This already has a `Deserialize` impl from version_trim_whitespace @@ -675,6 +679,10 @@ impl InheritableDependency { InheritableDependency::Inherit(_) => Err(UnresolvedError), } } + + pub fn is_inherited(&self) -> bool { + matches!(self, InheritableDependency::Inherit(_)) + } } impl<'de> de::Deserialize<'de> for InheritableDependency {