Skip to content

Commit 4f0e6a6

Browse files
committed
remove Database::flush
1 parent 3334c8d commit 4f0e6a6

File tree

6 files changed

+1
-19
lines changed

6 files changed

+1
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
- remove `flush` method from the `Database` trait.
89

910
## [v0.17.0] - [v0.16.1]
1011

src/database/any.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,6 @@ impl Database for AnyDatabase {
254254
fn increment_last_index(&mut self, keychain: KeychainKind) -> Result<u32, Error> {
255255
impl_inner_method!(AnyDatabase, self, increment_last_index, keychain)
256256
}
257-
258-
fn flush(&mut self) -> Result<(), Error> {
259-
impl_inner_method!(AnyDatabase, self, flush)
260-
}
261257
}
262258

263259
impl BatchOperations for AnyBatch {

src/database/keyvalue.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,6 @@ impl Database for Tree {
402402
Ok(val)
403403
})
404404
}
405-
406-
fn flush(&mut self) -> Result<(), Error> {
407-
Ok(Tree::flush(self).map(|_| ())?)
408-
}
409405
}
410406

411407
impl BatchDatabase for Tree {

src/database/memory.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,6 @@ impl Database for MemoryDatabase {
449449

450450
Ok(*value)
451451
}
452-
453-
fn flush(&mut self) -> Result<(), Error> {
454-
Ok(())
455-
}
456452
}
457453

458454
impl BatchDatabase for MemoryDatabase {

src/database/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,6 @@ pub trait Database: BatchOperations {
158158
///
159159
/// It should insert and return `0` if not present in the database
160160
fn increment_last_index(&mut self, keychain: KeychainKind) -> Result<u32, Error>;
161-
162-
/// Force changes to be written to disk
163-
fn flush(&mut self) -> Result<(), Error>;
164161
}
165162

166163
/// Trait for a database that supports batch operations

src/database/sqlite.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -881,10 +881,6 @@ impl Database for SqliteDatabase {
881881
}
882882
}
883883
}
884-
885-
fn flush(&mut self) -> Result<(), Error> {
886-
Ok(())
887-
}
888884
}
889885

890886
impl BatchDatabase for SqliteDatabase {

0 commit comments

Comments
 (0)