Skip to content

Commit 9c9599e

Browse files
committed
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.
1 parent 01fb029 commit 9c9599e

File tree

5 files changed

+5
-11
lines changed

5 files changed

+5
-11
lines changed

Diff for: src/tests/builders/publish.rs

-3
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ impl PublishBuilder {
142142
vers: u::EncodableCrateVersion(self.version.clone()),
143143
features: self.features.clone(),
144144
deps: self.deps.clone(),
145-
description: self.desc.clone(),
146145
homepage: None,
147146
documentation: self.doc_url.clone(),
148147
readme: self.readme,
@@ -161,8 +160,6 @@ impl PublishBuilder {
161160
.map(u::EncodableCategory)
162161
.collect(),
163162
),
164-
license: self.license.clone(),
165-
license_file: self.license_file.clone(),
166163
repository: None,
167164
links: None,
168165
};

Diff for: src/tests/krate/publish/keywords.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ fn bad_keywords() {
2424
assert_eq!(response.status(), StatusCode::OK);
2525
assert_eq!(
2626
response.into_json(),
27-
json!({ "errors": [{ "detail": "invalid upload request: invalid length 29, expected a keyword with less than 20 characters at line 1 column 203" }] })
27+
json!({ "errors": [{ "detail": "invalid upload request: invalid length 29, expected a keyword with less than 20 characters at line 1 column 175" }] })
2828
);
2929

3030
let crate_to_publish = PublishBuilder::new("foo_bad_key", "1.0.0").keyword("?@?%");
3131
let response = token.publish_crate(crate_to_publish);
3232
assert_eq!(response.status(), StatusCode::OK);
3333
assert_eq!(
3434
response.into_json(),
35-
json!({ "errors": [{ "detail": "invalid upload request: invalid value: string \"?@?%\", expected a valid keyword specifier at line 1 column 178" }] })
35+
json!({ "errors": [{ "detail": "invalid upload request: invalid value: string \"?@?%\", expected a valid keyword specifier at line 1 column 150" }] })
3636
);
3737

3838
let crate_to_publish = PublishBuilder::new("foo_bad_key", "1.0.0").keyword("áccênts");
3939
let response = token.publish_crate(crate_to_publish);
4040
assert_eq!(response.status(), StatusCode::OK);
4141
assert_eq!(
4242
response.into_json(),
43-
json!({ "errors": [{ "detail": "invalid upload request: invalid value: string \"áccênts\", expected a valid keyword specifier at line 1 column 183" }] })
43+
json!({ "errors": [{ "detail": "invalid upload request: invalid value: string \"áccênts\", expected a valid keyword specifier at line 1 column 155" }] })
4444
);
4545
}
4646

Diff for: src/tests/krate/publish/snapshots/all__krate__publish__categories__too_many_categories.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ expression: response.into_json()
55
{
66
"errors": [
77
{
8-
"detail": "invalid upload request: invalid length 6, expected at most 5 categories per crate at line 1 column 219"
8+
"detail": "invalid upload request: invalid length 6, expected at most 5 categories per crate at line 1 column 191"
99
}
1010
]
1111
}

Diff for: src/tests/krate/publish/snapshots/all__krate__publish__keywords__too_many_keywords.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ expression: response.into_json()
55
{
66
"errors": [
77
{
8-
"detail": "invalid upload request: invalid length 6, expected at most 5 keywords per crate at line 1 column 203"
8+
"detail": "invalid upload request: invalid length 6, expected at most 5 keywords per crate at line 1 column 175"
99
}
1010
]
1111
}

Diff for: src/views/krate_publish.rs

-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ pub struct PublishMetadata {
1818
pub vers: EncodableCrateVersion,
1919
pub deps: Vec<EncodableCrateDependency>,
2020
pub features: BTreeMap<EncodableFeatureName, Vec<EncodableFeature>>,
21-
pub description: Option<String>,
2221
pub homepage: Option<String>,
2322
pub documentation: Option<String>,
2423
pub readme: Option<String>,
@@ -27,8 +26,6 @@ pub struct PublishMetadata {
2726
pub keywords: EncodableKeywordList,
2827
#[serde(default)]
2928
pub categories: EncodableCategoryList,
30-
pub license: Option<String>,
31-
pub license_file: Option<String>,
3229
pub repository: Option<String>,
3330
#[serde(default)]
3431
pub links: Option<String>,

0 commit comments

Comments
 (0)