Skip to content

Commit

Permalink
Fix complete reade
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo committed Mar 25, 2024
1 parent 256dafe commit 6bc85c3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions core/src/layers/complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ impl<A: Accessor> CompleteAccessor<A> {
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
impl<A: Accessor> LayeredAccessor for CompleteAccessor<A> {
type Inner = A;
type Reader = A::Reader;
type BlockingReader = A::BlockingReader;
type Reader = CompleteReader<A::Reader>;
type BlockingReader = CompleteReader<A::BlockingReader>;
type Writer =
TwoWays<CompleteWriter<A::Writer>, oio::ExactBufWriter<CompleteWriter<A::Writer>>>;
type BlockingWriter = CompleteWriter<A::BlockingWriter>;
Expand Down Expand Up @@ -405,7 +405,10 @@ impl<A: Accessor> LayeredAccessor for CompleteAccessor<A> {
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)> {
Expand Down Expand Up @@ -518,7 +521,9 @@ impl<A: Accessor> LayeredAccessor for CompleteAccessor<A> {
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)> {
Expand Down

0 comments on commit 6bc85c3

Please sign in to comment.