Remove unwrap in filter_http_methods macro

This commit is contained in:
2022-07-10 00:57:05 +00:00
committed by GitHub
parent db8f30c978
commit 2f2a5c0eb1
3 changed files with 28 additions and 12 deletions

View File

@@ -28,9 +28,7 @@ impl ResponseJsonFor<Body> for VersionContext {
req: Request<Body>,
) -> Result<Response<JsonValue>, PixivDownloaderError> {
filter_http_methods!(req, json::object! {}, true, self.ctx, GET, OPTIONS, POST);
Ok(builder
.body(json::object! {"version": [0, 0, 1, 0]})
.unwrap())
Ok(builder.body(json::object! {"version": [0, 0, 1, 0]})?)
}
}