mirror of
https://github.com/tokio-rs/axum.git
synced 2025-09-27 04:50:31 +00:00
Implement IntoResponse
for boxed slices (#2035)
This commit is contained in:
parent
dadb14689a
commit
03da6db167
@ -241,6 +241,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 = Full::from(self).into_response();
|
||||
@ -366,6 +372,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 = Full::from(self).into_response();
|
||||
|
@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
# 0.6.18 (30. April, 2023)
|
||||
|
||||
- **fixed:** Don't remove the `Sec-WebSocket-Key` header in `WebSocketUpgrade` ([#1972])
|
||||
- **added:** Implement `IntoResponse` for `Box<str>` and `Box<[u8]>` ([#2035])
|
||||
|
||||
[#1972]: https://github.com/tokio-rs/axum/pull/1972
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user