Skip to content

Commit e75c292

Browse files
committed
Make crates.io compatible with whatsdeployed.io
1 parent 19e1c14 commit e75c292

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/controllers/site_metadata.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ pub fn show_deployed_sha(req: &mut dyn Request) -> CargoResult<Response> {
99
::std::env::var("HEROKU_SLUG_COMMIT").unwrap_or_else(|_| String::from("unknown"));
1010

1111
#[derive(Serialize)]
12-
struct R {
13-
deployed_sha: String,
12+
struct R<'a> {
13+
deployed_sha: &'a str,
14+
commit: &'a str,
1415
}
15-
Ok(req.json(&R { deployed_sha }))
16+
Ok(req.json(&R {
17+
deployed_sha: &deployed_sha[..],
18+
commit: &deployed_sha[..],
19+
}))
1620
}

0 commit comments

Comments
 (0)