Skip to content

Commit 07e3bb8

Browse files
committed
feat(test): Manual publishes set 'rust_version' in Index
1 parent 8bcf8fe commit 07e3bb8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

crates/cargo-test-support/src/publish.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ pub(crate) fn create_index_line(
165165
features: crate::registry::FeatureMap,
166166
yanked: bool,
167167
links: Option<String>,
168+
rust_version: Option<&str>,
168169
v: Option<u32>,
169170
) -> String {
170171
// This emulates what crates.io does to retain backwards compatibility.
@@ -185,6 +186,9 @@ pub(crate) fn create_index_line(
185186
if let Some(v) = v {
186187
json["v"] = serde_json::json!(v);
187188
}
189+
if let Some(rust_version) = rust_version {
190+
json["rust_version"] = serde_json::json!(rust_version);
191+
}
188192

189193
json.to_string()
190194
}

crates/cargo-test-support/src/registry.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,7 @@ fn save_new_crate(
11441144
false,
11451145
new_crate.links,
11461146
None,
1147+
None,
11471148
);
11481149

11491150
write_to_index(registry_path, &new_crate.name, line, false);
@@ -1400,6 +1401,7 @@ impl Package {
14001401
self.features.clone(),
14011402
self.yanked,
14021403
self.links.clone(),
1404+
self.rust_version.as_deref(),
14031405
self.v,
14041406
);
14051407

0 commit comments

Comments
 (0)