mirror of
https://github.com/Drop-OSS/dropbreak.git
synced 2026-07-19 20:43:35 -04:00
Remove mutable borrow from flush
This commit is contained in:
+2
-2
@@ -204,7 +204,7 @@ impl<T: Serialize + Deserialize + Eq + Hash> Database<T> {
|
||||
}
|
||||
|
||||
/// Flushes the Database to disk
|
||||
pub fn flush(&mut self) -> BreakResult<()> {
|
||||
pub fn flush(&self) -> BreakResult<()> {
|
||||
use bincode::serde::serialize;
|
||||
use bincode::SizeLimit;
|
||||
use std::io::Write;
|
||||
@@ -380,7 +380,7 @@ mod test {
|
||||
#[test]
|
||||
fn test_persistence() {
|
||||
let tmpf = NamedTempFile::new().unwrap();
|
||||
let mut db = Database::open(tmpf.path()).unwrap();
|
||||
let db = Database::open(tmpf.path()).unwrap();
|
||||
db.insert("test", "Hello World!").unwrap();
|
||||
db.flush().unwrap();
|
||||
drop(db);
|
||||
|
||||
Reference in New Issue
Block a user