From 322ec2ccc0df5df277883499f0a1563874944810 Mon Sep 17 00:00:00 2001 From: Douglas Dwyer Date: Sun, 22 Oct 2023 14:53:47 -0400 Subject: [PATCH] Remove is_empty and run cargo fmt --- src/db.rs | 6 +----- src/tree_store/page_store/file_backend/mod.rs | 2 +- src/tree_store/page_store/file_backend/unsupported.rs | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/db.rs b/src/db.rs index e35577a7..01a6033d 100644 --- a/src/db.rs +++ b/src/db.rs @@ -28,13 +28,9 @@ use crate::transactions::SAVEPOINT_TABLE; #[cfg(feature = "logging")] use log::{info, warn}; +#[allow(clippy::len_without_is_empty)] /// Implements persistent storage for a database. pub trait StorageBackend: 'static + Debug + Send + Sync { - /// Whether the current storage backend is of zero length. - fn is_empty(&self) -> Result { - Ok(self.len()? == 0) - } - /// Gets the current length of the storage. fn len(&self) -> Result; diff --git a/src/tree_store/page_store/file_backend/mod.rs b/src/tree_store/page_store/file_backend/mod.rs index 13b318d0..ef556225 100644 --- a/src/tree_store/page_store/file_backend/mod.rs +++ b/src/tree_store/page_store/file_backend/mod.rs @@ -11,4 +11,4 @@ pub use windows::FileBackend; #[cfg(not(any(windows, unix, target_os = "wasi")))] mod unsupported; #[cfg(not(any(windows, unix, target_os = "wasi")))] -pub use unsupported::FileBackend; \ No newline at end of file +pub use unsupported::FileBackend; diff --git a/src/tree_store/page_store/file_backend/unsupported.rs b/src/tree_store/page_store/file_backend/unsupported.rs index c4aeda39..9e2dfab6 100644 --- a/src/tree_store/page_store/file_backend/unsupported.rs +++ b/src/tree_store/page_store/file_backend/unsupported.rs @@ -33,4 +33,4 @@ impl StorageBackend for FileBackend { fn write(&self, _: u64, _: &[u8]) -> Result<(), io::Error> { unimplemented!() } -} \ No newline at end of file +}