Skip to content

Commit

Permalink
Invalidate restore_from method on MockDB
Browse files Browse the repository at this point in the history
  • Loading branch information
sug0 committed Aug 28, 2024
1 parent 6a70c2e commit 20cd06e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/storage/src/mockdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,25 @@ impl MockDB {
}
}

/// Source to restore a [`MockDB`] from.
///
/// Since this enum has no variants, you can't
/// actually restore a [`MockDB`] instance.
pub enum MockDBRestoreSource {}

impl DB for MockDB {
/// There is no cache for MockDB
type Cache = ();
type Migrator = ();
type RestoreSource<'a> = ();
type RestoreSource<'a> = MockDBRestoreSource;
type WriteBatch = MockDBWriteBatch;

fn open(_db_path: impl AsRef<Path>, _cache: Option<&Self::Cache>) -> Self {
Self::default()
}

fn restore_from(&mut self, _source: ()) -> Result<()> {
Ok(())
fn restore_from(&mut self, source: MockDBRestoreSource) -> Result<()> {
match source {}
}

fn flush(&self, _wait: bool) -> Result<()> {
Expand Down

0 comments on commit 20cd06e

Please sign in to comment.