diff --git a/object_store/src/client/mod.rs b/object_store/src/client/mod.rs index 6840f91da8b0..90317991ab90 100644 --- a/object_store/src/client/mod.rs +++ b/object_store/src/client/mod.rs @@ -580,7 +580,7 @@ impl GetOptionsExt for RequestBuilder { use hyper::header::*; if let Some(range) = options.range { - self = self.header(RANGE, format!("bytes={range}")); + self = self.header(RANGE, range.to_string()); } if let Some(tag) = options.if_match { diff --git a/object_store/src/util.rs b/object_store/src/util.rs index 96d724ed09b4..6854a17732a3 100644 --- a/object_store/src/util.rs +++ b/object_store/src/util.rs @@ -258,9 +258,9 @@ impl GetRange { impl Display for GetRange { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::Bounded(r) => f.write_fmt(format_args!("{}-{}", r.start, r.end - 1)), - Self::Offset(o) => f.write_fmt(format_args!("{o}-")), - Self::Suffix(n) => f.write_fmt(format_args!("-{n}")), + Self::Bounded(r) => f.write_fmt(format_args!("bytes={}-{}", r.start, r.end - 1)), + Self::Offset(o) => f.write_fmt(format_args!("bytes={o}-")), + Self::Suffix(n) => f.write_fmt(format_args!("bytes=-{n}")), } } }