Skip to content

Commit

Permalink
Fix deprecated notmuch::Database::open
Browse files Browse the repository at this point in the history
  • Loading branch information
OJFord committed Mar 12, 2024
1 parent ddb80f6 commit c9899eb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions notmuch-more/src/database.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::NotmuchMoreError;
use std::path::Path;

pub struct Database {
path: String,
Expand All @@ -10,16 +11,20 @@ impl Database {
}

pub fn open_ro(&self) -> Result<notmuch::Database, NotmuchMoreError> {
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<notmuch::Database, NotmuchMoreError> {
Ok(notmuch::Database::open(
&self.path,
Ok(notmuch::Database::open_with_config(
Some(&self.path),
notmuch::DatabaseMode::ReadWrite,
None::<&Path>,
None,
)?)
}
}

0 comments on commit c9899eb

Please sign in to comment.