From 92728f283eeae18329c8f8ad30006555641991e8 Mon Sep 17 00:00:00 2001 From: acehinnnqru Date: Fri, 15 Sep 2023 15:45:00 +0800 Subject: [PATCH] feat(services/azblob): use OpStat instead of OpRead in azblob_get_blob_properties --- core/src/services/azblob/backend.rs | 5 +---- core/src/services/azblob/core.rs | 4 ++-- core/src/services/azblob/writer.rs | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/core/src/services/azblob/backend.rs b/core/src/services/azblob/backend.rs index a8cf497cf916..627d6fb02c49 100644 --- a/core/src/services/azblob/backend.rs +++ b/core/src/services/azblob/backend.rs @@ -625,10 +625,7 @@ impl Accessor for AzblobBackend { return Ok(RpStat::new(Metadata::new(EntryMode::DIR))); } - let resp = self - .core - .azblob_get_blob_properties(path, &args.to_owned().into()) - .await?; + let resp = self.core.azblob_get_blob_properties(path, &args).await?; let status = resp.status(); diff --git a/core/src/services/azblob/core.rs b/core/src/services/azblob/core.rs index 71666a1b3795..7db0556602e3 100644 --- a/core/src/services/azblob/core.rs +++ b/core/src/services/azblob/core.rs @@ -406,9 +406,9 @@ impl AzblobCore { pub async fn azblob_get_blob_properties( &self, path: &str, - args: &OpRead, + args: &OpStat, ) -> Result> { - let mut req = self.azblob_head_blob_request(path, &args.to_owned().into())?; + let mut req = self.azblob_head_blob_request(path, args)?; self.sign(&mut req).await?; self.send(req).await diff --git a/core/src/services/azblob/writer.rs b/core/src/services/azblob/writer.rs index 91be6cb6a0a9..d78ae8dc7f9b 100644 --- a/core/src/services/azblob/writer.rs +++ b/core/src/services/azblob/writer.rs @@ -75,7 +75,7 @@ impl oio::AppendObjectWrite for AzblobWriter { async fn offset(&self) -> Result { let resp = self .core - .azblob_get_blob_properties(&self.path, &OpRead::default()) + .azblob_get_blob_properties(&self.path, &OpStat::default()) .await?; let status = resp.status();