mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-29 00:00:18 +02:00
Implement IntoResponse for [u8; N] and &'static [u8; N] (#1690)
Co-authored-by: David Pedersen <[email protected]>
This commit is contained in:
co-authored by
David Pedersen
parent
e3aaeb3cb7
commit
e4c6d76bca
@@ -348,6 +348,18 @@ impl IntoResponse for &'static [u8] {
|
||||
}
|
||||
}
|
||||
|
||||
impl<const N: usize> IntoResponse for &'static [u8; N] {
|
||||
fn into_response(self) -> Response {
|
||||
self.as_slice().into_response()
|
||||
}
|
||||
}
|
||||
|
||||
impl<const N: usize> IntoResponse for [u8; N] {
|
||||
fn into_response(self) -> Response {
|
||||
self.to_vec().into_response()
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoResponse for Vec<u8> {
|
||||
fn into_response(self) -> Response {
|
||||
Cow::<'static, [u8]>::Owned(self).into_response()
|
||||
|
||||
Reference in New Issue
Block a user