From 4abc9e2a61cb3328817d54c88a66b702daac6b64 Mon Sep 17 00:00:00 2001 From: Christian Meusel Date: Sun, 10 Dec 2023 20:23:44 +0100 Subject: [PATCH] feat: Harmonize fields between Version and FullVersion Shouldn't the FullVersion include all fields from Version? --- src/types.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/types.rs b/src/types.rs index 92b06a1..6909998 100644 --- a/src/types.rs +++ b/src/types.rs @@ -555,6 +555,8 @@ impl ReverseDependencies { #[derive(Serialize, Deserialize, Debug, Clone)] #[allow(missing_docs)] pub struct FullVersion { + #[serde(rename = "crate")] + pub crate_name: String, pub created_at: DateTime, pub updated_at: DateTime, pub dl_path: String, @@ -566,7 +568,11 @@ pub struct FullVersion { pub license: Option, pub readme_path: Option, pub links: VersionLinks, + pub crate_size: Option, + pub published_by: Option, pub rust_version: Option, + #[serde(default)] + pub audit_actions: Vec, pub author_names: Vec, pub dependencies: Vec, @@ -576,6 +582,7 @@ impl FullVersion { /// Creates a [`FullVersion`] from a [`Version`], author names, and dependencies. pub fn from_parts(version: Version, authors: Authors, dependencies: Vec) -> Self { FullVersion { + crate_name: version.crate_name, created_at: version.created_at, updated_at: version.updated_at, dl_path: version.dl_path, @@ -587,7 +594,10 @@ impl FullVersion { license: version.license, links: version.links, readme_path: version.readme_path, + crate_size: version.crate_size, + published_by: version.published_by, rust_version: version.rust_version, + audit_actions: version.audit_actions, author_names: authors.names, dependencies,