Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/cargo-util-schemas/src/manifest/mod.rs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parsing backend for crates-io

I am fine we adding these helper functions. Just curious about the thing you're doing. Mind sharing a bit more?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am experimenting with replacing the toml parsing backend of crates.io with cargo_util_schemas since that's what cargo is using to produce the toml file in cargo package.

It's just an experiment, so I'd like to keep these either way (I also wanna use c_u_s for an own registry I'm implementing)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replacing with cargo-util-schemas in the official crates.io project? You might want to look at rust-lang/crates.io#7811, and the other functionalities it is using that cargo-utuil-schemas lacks.

Anyway, thanks for the info. Merging!

Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ impl<T> InheritableField<T> {
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
Expand Down Expand Up @@ -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 {
Expand Down
Loading