From c8fc07f09cb5ea87fd2568f4f086be3020fd1b90 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 27 Sep 2023 12:57:54 +0200 Subject: [PATCH] views/krate_publish: Remove obsolete `description`, `license`, and `license_file` fields These fields are no longer read by our server, so we can skip the deserialization step. --- src/tests/builders/publish.rs | 3 --- .../all__krate__publish__categories__too_many_categories.snap | 2 +- .../all__krate__publish__keywords__too_many_keywords.snap | 2 +- src/views/krate_publish.rs | 3 --- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/tests/builders/publish.rs b/src/tests/builders/publish.rs index cb7c832adfe..6a344a62531 100644 --- a/src/tests/builders/publish.rs +++ b/src/tests/builders/publish.rs @@ -142,7 +142,6 @@ impl PublishBuilder { vers: u::EncodableCrateVersion(self.version.clone()), features: self.features.clone(), deps: self.deps.clone(), - description: self.desc.clone(), homepage: None, documentation: self.doc_url.clone(), readme: self.readme, @@ -161,8 +160,6 @@ impl PublishBuilder { .map(u::EncodableCategory) .collect(), ), - license: self.license.clone(), - license_file: self.license_file.clone(), repository: None, links: None, }; diff --git a/src/tests/krate/publish/snapshots/all__krate__publish__categories__too_many_categories.snap b/src/tests/krate/publish/snapshots/all__krate__publish__categories__too_many_categories.snap index 8233e425e68..f1300f6967d 100644 --- a/src/tests/krate/publish/snapshots/all__krate__publish__categories__too_many_categories.snap +++ b/src/tests/krate/publish/snapshots/all__krate__publish__categories__too_many_categories.snap @@ -5,7 +5,7 @@ expression: response.into_json() { "errors": [ { - "detail": "invalid upload request: invalid length 6, expected at most 5 categories per crate at line 1 column 219" + "detail": "invalid upload request: invalid length 6, expected at most 5 categories per crate at line 1 column 191" } ] } diff --git a/src/tests/krate/publish/snapshots/all__krate__publish__keywords__too_many_keywords.snap b/src/tests/krate/publish/snapshots/all__krate__publish__keywords__too_many_keywords.snap index 1590ab10118..45130bd6de1 100644 --- a/src/tests/krate/publish/snapshots/all__krate__publish__keywords__too_many_keywords.snap +++ b/src/tests/krate/publish/snapshots/all__krate__publish__keywords__too_many_keywords.snap @@ -5,7 +5,7 @@ expression: response.into_json() { "errors": [ { - "detail": "invalid upload request: invalid length 6, expected at most 5 keywords per crate at line 1 column 203" + "detail": "invalid upload request: invalid length 6, expected at most 5 keywords per crate at line 1 column 175" } ] } diff --git a/src/views/krate_publish.rs b/src/views/krate_publish.rs index e61769bf924..4c1c94be9eb 100644 --- a/src/views/krate_publish.rs +++ b/src/views/krate_publish.rs @@ -18,7 +18,6 @@ pub struct PublishMetadata { pub vers: EncodableCrateVersion, pub deps: Vec, pub features: BTreeMap>, - pub description: Option, pub homepage: Option, pub documentation: Option, pub readme: Option, @@ -27,8 +26,6 @@ pub struct PublishMetadata { pub keywords: EncodableKeywordList, #[serde(default)] pub categories: EncodableCategoryList, - pub license: Option, - pub license_file: Option, pub repository: Option, #[serde(default)] pub links: Option,