Skip to content

Commit e2da9d5

Browse files
cassaundraTurbo87
authored andcommitted
index: Add rust_version field
1 parent fcf14b2 commit e2da9d5

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

cargo-registry-index/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ pub struct Crate {
125125
pub yanked: Option<bool>,
126126
#[serde(skip_serializing_if = "Option::is_none")]
127127
pub links: Option<String>,
128+
#[serde(skip_serializing_if = "Option::is_none")]
129+
pub rust_version: Option<String>,
128130
/// The schema version for this entry.
129131
///
130132
/// If this is None, it defaults to version 1. Entries with unknown
@@ -634,6 +636,7 @@ mod tests {
634636
features2: None,
635637
yanked: None,
636638
links: None,
639+
rust_version: None,
637640
v: None,
638641
};
639642
let mut buffer = Vec::new();
@@ -657,6 +660,7 @@ mod tests {
657660
features2: None,
658661
yanked: None,
659662
links: None,
663+
rust_version: None,
660664
v: None,
661665
})
662666
.collect::<Vec<_>>();

src/controllers/krate/publish.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ pub async fn publish(app: AppState, req: BytesRequest) -> AppResult<Json<GoodCra
211211
user.id,
212212
hex_cksum.clone(),
213213
links.clone(),
214-
rust_version,
214+
rust_version.clone(),
215215
)?
216216
.save(conn, &verified_email_address)?;
217217

@@ -277,6 +277,7 @@ pub async fn publish(app: AppState, req: BytesRequest) -> AppResult<Json<GoodCra
277277
deps: git_deps,
278278
yanked: Some(false),
279279
links,
280+
rust_version,
280281
v,
281282
};
282283

src/models/krate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ impl Crate {
510510
deps,
511511
features,
512512
links: version.links,
513+
rust_version: version.rust_version,
513514
features2,
514515
v,
515516
};

0 commit comments

Comments
 (0)