From be3499397ca7a218e4f3af7ae4e78920336278ea Mon Sep 17 00:00:00 2001 From: Raphael Taylor-Davies Date: Tue, 24 Oct 2023 19:11:34 +0100 Subject: [PATCH] Clippy --- object_store/src/client/header.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/object_store/src/client/header.rs b/object_store/src/client/header.rs index 38aca8e2f013..e85bf6ba52d0 100644 --- a/object_store/src/client/header.rs +++ b/object_store/src/client/header.rs @@ -18,7 +18,7 @@ //! Logic for extracting ObjectMeta from headers used by AWS, GCP and Azure use crate::path::Path; -use crate::{ObjectMeta, PutResult}; +use crate::ObjectMeta; use chrono::{DateTime, TimeZone, Utc}; use hyper::header::{CONTENT_LENGTH, ETAG, LAST_MODIFIED}; use hyper::HeaderMap; @@ -67,14 +67,16 @@ pub enum Error { }, } -/// Extracts a [`PutResult`] from the provided [`HeaderMap`] -pub fn get_put_result(headers: &HeaderMap, version: &str) -> Result { +/// Extracts a PutResult from the provided [`HeaderMap`] +#[cfg(any(feature = "aws", feature = "gcp", feature = "azure"))] +pub fn get_put_result(headers: &HeaderMap, version: &str) -> Result { let e_tag = Some(get_etag(headers)?); let version = get_version(headers, version)?; - Ok(PutResult { e_tag, version }) + Ok(crate::PutResult { e_tag, version }) } /// Extracts a optional version from the provided [`HeaderMap`] +#[cfg(any(feature = "aws", feature = "gcp", feature = "azure"))] pub fn get_version(headers: &HeaderMap, version: &str) -> Result, Error> { Ok(match headers.get(version) { Some(x) => Some(x.to_str().context(BadHeaderSnafu)?.to_string()),