(body: &impl Serialize)
| 135 | } |
| 136 | |
| 137 | fn json_response(body: &impl Serialize) -> Result<Response<String>> { |
| 138 | let body = serde_json::to_string(body).context("Failed to serialize response")?; |
| 139 | Response::builder() |
| 140 | .status(StatusCode::OK) |
| 141 | .header("Content-Type", "application/json") |
| 142 | .body(body) |
| 143 | .context("Failed to build response") |
| 144 | } |
| 145 | |
| 146 | fn empty_response(status: StatusCode) -> Result<Response<String>> { |
| 147 | Response::builder() |
no test coverage detected