From 4d4dcf4f96874d823918aa86da46428436d59cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Sat, 15 Oct 2016 23:12:13 +0200 Subject: [PATCH] Remove mutable borrow from flush --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index fe2b432..0e37950 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -204,7 +204,7 @@ impl Database { } /// 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);