Xuanwo commented on PR #3763:
URL:
https://github.com/apache/incubator-opendal/pull/3763#issuecomment-1862321620
Ok, I re-visit your code and find an issue.
```rust
let mut f = self.f.take(self.size).expect("FsWriter must be initialized");
```
The `take` here is different from `take` we used in fs service:
https://github.com/apache/incubator-opendal/blob/268d5b8784ce9f30e9c0b70dc6201107a0d5b8f1/core/src/services/fs/writer.rs#L77
The `FsWriter`'s struct is:
```rust
pub struct FsWriter<F> {
target_path: PathBuf,
tmp_path: Option<PathBuf>,
f: Option<F>,
fut: Option<BoxFuture<'static, Result<()>>>,
}
```
While we calling `self.f.take()`, we take the `F` out from `FsWriter`. So we
have the ownership here instead of just a mutable reference.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]