From 0c55e4e4d5bb8b9098fc6f780a74e99f436153c0 Mon Sep 17 00:00:00 2001 From: "C. Morgan Hamill" Date: Tue, 24 Mar 2015 14:55:02 -0400 Subject: Make methods borrow self mutably when appropriate. Use of raw pointers and FFI functions mean that the compiler won't force us to be correct in our usage of `&self` vs. `&mut self`. These functions make changes to the notmuch database, and we want the type system to ensure we can't simultaneously manipulate the database from different functions. --- src/database.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/database.rs b/src/database.rs index 46ca45d..7469bb0 100644 --- a/src/database.rs +++ b/src/database.rs @@ -118,16 +118,16 @@ impl Database { } } - pub fn upgrade(&self) -> Result<()> { + pub fn upgrade(&mut self) -> Result<()> { let status: Option = None; self._upgrade(status) } - pub fn upgrade_with_status(&self, status: F) -> Result<()> { + pub fn upgrade_with_status(&mut self, status: F) -> Result<()> { self._upgrade(Some(status)) } - fn _upgrade(&self, status: Option) -> Result<()> { + fn _upgrade(&mut self, status: Option) -> Result<()> { extern fn wrapper( closure: *mut libc::c_void, progress: libc::c_double, -- cgit v1.2.1