Skip to content

Commit

Permalink
fix cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorgan committed Jan 19, 2025
1 parent 7c158fe commit 5c98d37
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/layers/dtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ impl<R: oio::Write> oio::Write for DtraceLayerWrapper<R> {
})
}

async fn close(&mut self) -> Result<()> {
async fn close(&mut self) -> Result<Metadata> {
let c_path = CString::new(self.path.clone()).unwrap();
probe_lazy!(opendal, writer_close_start, c_path.as_ptr());
self.inner
Expand Down Expand Up @@ -413,7 +413,7 @@ impl<R: oio::BlockingWrite> oio::BlockingWrite for DtraceLayerWrapper<R> {
})
}

fn close(&mut self) -> Result<()> {
fn close(&mut self) -> Result<Metadata> {
let c_path = CString::new(self.path.clone()).unwrap();
probe_lazy!(opendal, blocking_writer_close_start, c_path.as_ptr());
self.inner
Expand Down
4 changes: 4 additions & 0 deletions core/tests/behavior/async_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,10 @@ pub async fn test_writer_futures_copy_with_concurrent(op: Operator) -> Result<()
}

pub async fn test_writer_return_metadata(op: Operator) -> Result<()> {
if !op.info().full_capability().write_can_multi {
return Ok(());
}

let path = TEST_FIXTURE.new_file_path();
let size = 5 * 1024 * 1024; // write file with 5 MiB
let content_a = gen_fixed_bytes(size);
Expand Down
2 changes: 1 addition & 1 deletion integrations/fuse3/src/file_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ impl PathFilesystem for Filesystem {
if let Some(inner_writer) = file.inner_writer {
let mut lock = inner_writer.lock().await;
let res = lock.writer.close().await.map_err(opendal_error2errno);
return res;
return res.map(|_| ());
}

if matches!(path, Some(ref p) if p != &file.path) {
Expand Down
1 change: 1 addition & 0 deletions integrations/parquet/src/async_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ impl AsyncFileWriter for AsyncWriter {
self.inner
.close()
.await
.map(|_| ())
.map_err(|err| ParquetError::External(Box::new(err)))
})
}
Expand Down

0 comments on commit 5c98d37

Please sign in to comment.