aboutsummaryrefslogtreecommitdiff
path: root/src/api/helpers.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-07 14:45:52 +0100
committerAlex Auvolat <alex@adnab.me>2024-02-07 14:45:52 +0100
commite524e7a30d4d81c84f1c110017ad972dc5617bf6 (patch)
tree446b074e199c47c109fa517e5ec6717c2fe15b5f /src/api/helpers.rs
parentfe48d60d2b63a9914297558bd5dbccae8d96c947 (diff)
downloadgarage-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.rs6
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>