Skip to content

Commit 00670b3

Browse files
authored
Merge pull request #650 from Fishrock123/response-from-statuscode
Response: add From<StatusCode>
2 parents 261038d + 55a9023 commit 00670b3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/response.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,13 @@ impl From<http::Response> for Response {
398398
}
399399
}
400400

401+
impl From<StatusCode> for Response {
402+
fn from(status: StatusCode) -> Self {
403+
let res: http::Response = status.into();
404+
res.into()
405+
}
406+
}
407+
401408
impl From<String> for Response {
402409
fn from(s: String) -> Self {
403410
Body::from_string(s).into()

0 commit comments

Comments
 (0)