diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-02-21 17:29:23 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-02-21 17:29:23 +0100 |
commit | 906dd6a07767d34db99fb275c4b708fdc2926349 (patch) | |
tree | cd6890a20916fd4ba45e5dfa5388c312c2a459cd | |
parent | 748e219c33020b2b394dcc3740eade4266160690 (diff) |
Implement Deref to Store for MailStoreWithConnection
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | lib/domain/libimagmail/src/store.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/domain/libimagmail/src/store.rs b/lib/domain/libimagmail/src/store.rs index 3b4caa9a..92b85bfe 100644 --- a/lib/domain/libimagmail/src/store.rs +++ b/lib/domain/libimagmail/src/store.rs @@ -18,6 +18,7 @@ // use std::borrow::Cow; +use std::ops::Deref; use failure::Fallible as Result; use toml_query::insert::TomlValueInsertExt; @@ -54,6 +55,14 @@ pub struct MailStoreWithConnection<'a> { connection: &'a NotmuchConnection, } +impl<'a> Deref for MailStoreWithConnection<'a> { + type Target = Store; + + fn deref(&self) -> &Self::Target { + self.store + } +} + impl<'a> MailStoreWithConnection<'a> { pub(crate) fn connection(&self) -> &NotmuchConnection { &self.connection |