refactor: use std::io::Error::other() instead of Error::new(ErrorKind::Other, e)

This commit is contained in:
Omar Sobh
2026-05-21 09:40:53 -07:00
parent 3f222f6956
commit d1f74702c0
2 changed files with 9 additions and 10 deletions
+7 -7
View File
@@ -464,8 +464,8 @@ async fn background_writer(
Ok(indices)
})
.await
.unwrap_or_else(|e| Err(MemoryError::Io(std::io::Error::new(
std::io::ErrorKind::Other, e,
.unwrap_or_else(|e| Err(MemoryError::Io(std::io::Error::other(
e,
))));
dirty = result.is_ok();
let _ = reply.send(result);
@@ -498,8 +498,8 @@ async fn background_writer(
m.flush_wal()
})
.await
.unwrap_or_else(|e| Err(MemoryError::Io(std::io::Error::new(
std::io::ErrorKind::Other, e,
.unwrap_or_else(|e| Err(MemoryError::Io(std::io::Error::other(
e,
))));
if result.is_ok() { dirty = false; }
let _ = reply.send(result);
@@ -515,8 +515,8 @@ async fn background_writer(
m.tick_session()
})
.await
.unwrap_or_else(|e| Err(MemoryError::Io(std::io::Error::new(
std::io::ErrorKind::Other, e,
.unwrap_or_else(|e| Err(MemoryError::Io(std::io::Error::other(
e,
))));
if result.is_ok() { dirty = false; }
let _ = reply.send(result);
@@ -549,7 +549,7 @@ async fn background_writer(
// ---------------------------------------------------------------------------
fn join_err(e: tokio::task::JoinError) -> MemoryError {
MemoryError::Io(std::io::Error::new(std::io::ErrorKind::Other, e))
MemoryError::Io(std::io::Error::other(e))
}
fn channel_gone() -> MemoryError {