diff options
author | Alex Auvolat <alex@adnab.me> | 2020-07-07 17:15:53 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-07-07 17:15:53 +0200 |
commit | f22ecb60a8e1848de95e1bd3104b0ceec7058f0c (patch) | |
tree | 1e51db048f17295a070aae4025bfa16036a3c0fd /src/api/s3_list.rs | |
parent | 3b0b11085e0501afcc16f6a75632a4d425146158 (diff) | |
download | garage-f22ecb60a8e1848de95e1bd3104b0ceec7058f0c.tar.gz garage-f22ecb60a8e1848de95e1bd3104b0ceec7058f0c.zip |
Update to Hyper 0.13.6 that accepts non-Sync streams in wrap_stream.
Simplifies code and makes it possible to publish on crates.io
Diffstat (limited to 'src/api/s3_list.rs')
-rw-r--r-- | src/api/s3_list.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/api/s3_list.rs b/src/api/s3_list.rs index c4fbf6f2..1f0eccf5 100644 --- a/src/api/s3_list.rs +++ b/src/api/s3_list.rs @@ -3,14 +3,13 @@ use std::fmt::Write; use std::sync::Arc; use chrono::{DateTime, NaiveDateTime, SecondsFormat, Utc}; -use hyper::Response; +use hyper::{Body, Response}; use garage_util::error::Error; use garage_model::garage::Garage; use crate::encoding::*; -use crate::http_util::*; #[derive(Debug)] struct ListResultInfo { @@ -26,7 +25,7 @@ pub async fn handle_list( prefix: &str, marker: Option<&str>, urlencode_resp: bool, -) -> Result<Response<BodyType>, Error> { +) -> Result<Response<Body>, Error> { let mut result_keys = BTreeMap::<String, ListResultInfo>::new(); let mut result_common_prefixes = BTreeSet::<String>::new(); @@ -141,5 +140,5 @@ pub async fn handle_list( writeln!(&mut xml, "</ListBucketResult>").unwrap(); println!("{}", xml); - Ok(Response::new(Box::new(BytesBody::from(xml.into_bytes())))) + Ok(Response::new(Body::from(xml.into_bytes()))) } |