This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch cleanup
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git

commit bf2ff23f36fde4a6185763d88c3b862747818d18
Author: Xuanwo <[email protected]>
AuthorDate: Thu Nov 16 22:52:34 2023 +0800

    Make clippy happy
    
    Signed-off-by: Xuanwo <[email protected]>
---
 core/src/raw/oio/write/one_shot_write.rs | 32 ++++++++++++++------------------
 core/src/services/alluxio/backend.rs     |  2 --
 2 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/core/src/raw/oio/write/one_shot_write.rs 
b/core/src/raw/oio/write/one_shot_write.rs
index 4efb3655b..a015b98a1 100644
--- a/core/src/raw/oio/write/one_shot_write.rs
+++ b/core/src/raw/oio/write/one_shot_write.rs
@@ -68,25 +68,21 @@ impl<W: OneShotWrite> OneShotWriter<W> {
 #[async_trait]
 impl<W: OneShotWrite> oio::Write for OneShotWriter<W> {
     fn poll_write(&mut self, _: &mut Context<'_>, bs: &dyn oio::WriteBuf) -> 
Poll<Result<usize>> {
-        loop {
-            match &mut self.state {
-                State::Idle(_) => {
-                    return match &self.buffer {
-                        Some(_) => Poll::Ready(Err(Error::new(
-                            ErrorKind::Unsupported,
-                            "OneShotWriter doesn't support multiple write",
-                        ))),
-                        None => {
-                            let size = bs.remaining();
-                            let bs = bs.vectored_bytes(size);
-                            self.buffer = 
Some(oio::ChunkedBytes::from_vec(bs));
-                            Poll::Ready(Ok(size))
-                        }
-                    }
-                }
-                State::Write(_) => {
-                    unreachable!("OneShotWriter must not go into State::Write 
during poll_write")
+        match &mut self.state {
+            State::Idle(_) => match &self.buffer {
+                Some(_) => Poll::Ready(Err(Error::new(
+                    ErrorKind::Unsupported,
+                    "OneShotWriter doesn't support multiple write",
+                ))),
+                None => {
+                    let size = bs.remaining();
+                    let bs = bs.vectored_bytes(size);
+                    self.buffer = Some(oio::ChunkedBytes::from_vec(bs));
+                    Poll::Ready(Ok(size))
                 }
+            },
+            State::Write(_) => {
+                unreachable!("OneShotWriter must not go into State::Write 
during poll_write")
             }
         }
     }
diff --git a/core/src/services/alluxio/backend.rs 
b/core/src/services/alluxio/backend.rs
index 64db4461f..b9fa28695 100644
--- a/core/src/services/alluxio/backend.rs
+++ b/core/src/services/alluxio/backend.rs
@@ -198,8 +198,6 @@ impl Accessor for AlluxioBackend {
                 read: true,
 
                 write: true,
-                /// https://github.com/Alluxio/alluxio/issues/8212
-                write_can_append: false,
                 write_can_multi: true,
 
                 create_dir: true,

Reply via email to