From c9899ebaeb24d2787b60ebb3e45fc6c781173edd Mon Sep 17 00:00:00 2001 From: Oliver Ford Date: Tue, 12 Mar 2024 00:20:19 +0000 Subject: [PATCH] Fix deprecated `notmuch::Database::open` --- notmuch-more/src/database.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/notmuch-more/src/database.rs b/notmuch-more/src/database.rs index f85116c..bad371a 100644 --- a/notmuch-more/src/database.rs +++ b/notmuch-more/src/database.rs @@ -1,4 +1,5 @@ use crate::NotmuchMoreError; +use std::path::Path; pub struct Database { path: String, @@ -10,16 +11,20 @@ impl Database { } pub fn open_ro(&self) -> Result { - Ok(notmuch::Database::open( - &self.path, + Ok(notmuch::Database::open_with_config( + Some(&self.path), notmuch::DatabaseMode::ReadOnly, + None::<&Path>, + None, )?) } pub fn open_rw(&self) -> Result { - Ok(notmuch::Database::open( - &self.path, + Ok(notmuch::Database::open_with_config( + Some(&self.path), notmuch::DatabaseMode::ReadWrite, + None::<&Path>, + None, )?) } }