Skip to content

Commit

Permalink
Remove is_empty and run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
DouglasDwyer committed Oct 22, 2023
1 parent 320dea3 commit 322ec2c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool, io::Error> {
Ok(self.len()? == 0)
}

/// Gets the current length of the storage.
fn len(&self) -> Result<u64, io::Error>;

Expand Down
2 changes: 1 addition & 1 deletion src/tree_store/page_store/file_backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
pub use unsupported::FileBackend;
2 changes: 1 addition & 1 deletion src/tree_store/page_store/file_backend/unsupported.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ impl StorageBackend for FileBackend {
fn write(&self, _: u64, _: &[u8]) -> Result<(), io::Error> {
unimplemented!()
}
}
}

0 comments on commit 322ec2c

Please sign in to comment.