-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using cargo-util-schemas instead of cargo_toml #1361
Labels
enhancement
New feature or request
Comments
The beginning of this could look something like let data = std::fs::read_to_string(path)?;
let m: cargo_util_schemas::manifest::TomlManifest = toml::from_str(&data)?; and then perhaps let package = *m.package.context("Not a package (only a workspace)")?;
let description = package.description.map(|v| v.as_value().cloned()).flatten(); but after that there are decisions and/or slightly more invasive changes to be made. In particular, Lines 6 to 14 in ac7e2b8
|
If you'd like, feel free to submit a PR 🙂 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary 💡
As suggested in a Fedora package review, you might consider replacing the
cargo_toml
crate withcargo-util-schemas
(plustoml
). Whilecargo-util-schemas
doesn’t have as much high-level functionality ascargo_toml
, it seems like it should be adequate for whatonefetch-manifest
needs.Motivation 🔦
The advantage of
cargo-util-schemas
is that it is the official implementation of serialization and deserialization schemas used by cargo itself, so if you use it, you can be confident that yourCargo.toml
support remains consistent with cargo‘s.The text was updated successfully, but these errors were encountered: