From 6bc85c30295601302884f54f554e8ffab57f79b7 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Mon, 25 Mar 2024 21:17:56 +0800 Subject: [PATCH] Fix complete reade Signed-off-by: Xuanwo --- core/src/layers/complete.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/src/layers/complete.rs b/core/src/layers/complete.rs index 3565f64800d4..b694c6a6258b 100644 --- a/core/src/layers/complete.rs +++ b/core/src/layers/complete.rs @@ -375,8 +375,8 @@ impl CompleteAccessor { #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] impl LayeredAccessor for CompleteAccessor { type Inner = A; - type Reader = A::Reader; - type BlockingReader = A::BlockingReader; + type Reader = CompleteReader; + type BlockingReader = CompleteReader; type Writer = TwoWays, oio::ExactBufWriter>>; type BlockingWriter = CompleteWriter; @@ -405,7 +405,10 @@ impl LayeredAccessor for CompleteAccessor { if !capability.read { return Err(self.new_unsupported_error(Operation::Read)); } - self.inner.read(path, args).await + self.inner + .read(path, args) + .await + .map(|(rp, r)| (rp, CompleteReader(r))) } async fn write(&self, path: &str, args: OpWrite) -> Result<(RpWrite, Self::Writer)> { @@ -518,7 +521,9 @@ impl LayeredAccessor for CompleteAccessor { if !capability.read || !capability.blocking { return Err(self.new_unsupported_error(Operation::Read)); } - self.inner.blocking_read(path, args) + self.inner + .blocking_read(path, args) + .map(|(rp, r)| (rp, CompleteReader(r))) } fn blocking_write(&self, path: &str, args: OpWrite) -> Result<(RpWrite, Self::BlockingWriter)> {