mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-27 00:00:24 +02:00
Implement IntoResponse for boxed slices (#2035)
This commit is contained in:
@@ -190,6 +190,12 @@ impl IntoResponse for String {
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoResponse for Box<str> {
|
||||
fn into_response(self) -> Response {
|
||||
String::from(self).into_response()
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoResponse for Cow<'static, str> {
|
||||
fn into_response(self) -> Response {
|
||||
let mut res = Body::from(self).into_response();
|
||||
@@ -315,6 +321,12 @@ impl IntoResponse for Vec<u8> {
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoResponse for Box<[u8]> {
|
||||
fn into_response(self) -> Response {
|
||||
Vec::from(self).into_response()
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoResponse for Cow<'static, [u8]> {
|
||||
fn into_response(self) -> Response {
|
||||
let mut res = Body::from(self).into_response();
|
||||
|
||||
Reference in New Issue
Block a user