diff options
author | Alex Auvolat <alex@adnab.me> | 2024-02-07 14:45:52 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2024-02-07 14:45:52 +0100 |
commit | e524e7a30d4d81c84f1c110017ad972dc5617bf6 (patch) | |
tree | 446b074e199c47c109fa517e5ec6717c2fe15b5f /src/api/helpers.rs | |
parent | fe48d60d2b63a9914297558bd5dbccae8d96c947 (diff) | |
download | garage-e524e7a30d4d81c84f1c110017ad972dc5617bf6.tar.gz garage-e524e7a30d4d81c84f1c110017ad972dc5617bf6.zip |
[dep-upgrade-202402] rename BytesBody into ErrorBody for clarity
Diffstat (limited to 'src/api/helpers.rs')
-rw-r--r-- | src/api/helpers.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/helpers.rs b/src/api/helpers.rs index 57aa1ea1..66f4c465 100644 --- a/src/api/helpers.rs +++ b/src/api/helpers.rs @@ -144,7 +144,7 @@ pub fn key_after_prefix(pfx: &str) -> Option<String> { // =============== body helpers ================= pub type EmptyBody = http_body_util::Empty<bytes::Bytes>; -pub type BytesBody = FullBody<bytes::Bytes>; +pub type ErrorBody = FullBody<bytes::Bytes>; pub type BoxBody<E> = http_body_util::combinators::BoxBody<bytes::Bytes, E>; pub fn string_body<E>(s: String) -> BoxBody<E> { @@ -156,8 +156,8 @@ pub fn bytes_body<E>(b: bytes::Bytes) -> BoxBody<E> { pub fn empty_body<E>() -> BoxBody<E> { BoxBody::new(http_body_util::Empty::new().map_err(|_| unreachable!())) } -pub fn string_bytes_body(s: String) -> BytesBody { - BytesBody::from(bytes::Bytes::from(s.into_bytes())) +pub fn error_body(s: String) -> ErrorBody { + ErrorBody::from(bytes::Bytes::from(s.into_bytes())) } pub async fn parse_json_body<T, B, E>(req: Request<B>) -> Result<T, E> |