diff --git a/bdk-ffi/src/store.rs b/bdk-ffi/src/store.rs index d77f282f..d55352c6 100644 --- a/bdk-ffi/src/store.rs +++ b/bdk-ffi/src/store.rs @@ -8,23 +8,19 @@ use bdk_wallet::KeychainKind; use std::sync::{Arc, Mutex, MutexGuard}; -pub struct SqliteStore { - inner_mutex: Mutex>, -} +pub struct SqliteStore(Mutex>); impl SqliteStore { pub fn new(path: String) -> Result { let connection = Connection::open(path)?; let db = Store::new(connection)?; - Ok(Self { - inner_mutex: Mutex::new(db), - }) + Ok(Self(Mutex::new(db))) } pub(crate) fn get_store( &self, ) -> MutexGuard> { - self.inner_mutex.lock().expect("sqlite store") + self.0.lock().expect("sqlite store") } pub fn write(&self, changeset: &ChangeSet) -> Result<(), SqliteError> {