1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-22 21:55:10 +02:00

add convinience ClientRequest::build_from() from HttpRequest

This commit is contained in:
Nikolay Kim
2018-03-21 19:54:21 -07:00
parent 4866a26578
commit afb81b6b8f
2 changed files with 28 additions and 0 deletions

View File

@@ -71,6 +71,12 @@ impl HttpResponse {
}
}
/// Create http response builder
#[inline]
pub fn build_from<T: Into<HttpResponseBuilder>>(source: T) -> HttpResponseBuilder {
source.into()
}
/// Constructs a response
#[inline]
pub fn new(status: StatusCode, body: Body) -> HttpResponse {