We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
json!
1 parent 99e7ad8 commit 8726c20Copy full SHA for 8726c20
src/controllers/site_metadata.rs
@@ -8,13 +8,8 @@ pub fn show_deployed_sha(req: &mut dyn RequestExt) -> EndpointResult {
8
let deployed_sha =
9
dotenv::var("HEROKU_SLUG_COMMIT").unwrap_or_else(|_| String::from("unknown"));
10
11
- #[derive(Serialize)]
12
- struct R<'a> {
13
- deployed_sha: &'a str,
14
- commit: &'a str,
15
- }
16
- Ok(req.json(&R {
17
- deployed_sha: &deployed_sha[..],
18
- commit: &deployed_sha[..],
19
- }))
+ Ok(req.json(&json!({
+ "deployed_sha": &deployed_sha[..],
+ "commit": &deployed_sha[..],
+ })))
20
}
0 commit comments