diff options
Diffstat (limited to 'lib/domain/libimagmail/src/notmuch/thread.rs')
-rw-r--r-- | lib/domain/libimagmail/src/notmuch/thread.rs | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/lib/domain/libimagmail/src/notmuch/thread.rs b/lib/domain/libimagmail/src/notmuch/thread.rs deleted file mode 100644 index 9ac8223a..00000000 --- a/lib/domain/libimagmail/src/notmuch/thread.rs +++ /dev/null @@ -1,49 +0,0 @@ -// -// imag - the personal information management suite for the commandline -// Copyright (C) 2015-2020 Matthias Beyer <mail@beyermatthias.de> and contributors -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; version -// 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -// - -use notmuch_rs::Thread as NotmuchThread; - -pub struct Thread { - id: String, - msgs: Vec<String> -} - -impl From<NotmuchThread<'_, '_>> for Thread { - fn from(nmt: NotmuchThread) -> Self { - let msgs = nmt.messages() - .map(|msg| msg.id().into_owned()) - .collect(); - - Thread::new(nmt.id().to_owned(), msgs) - } -} - -impl Thread { - pub(crate) fn new(id: String, msgs: Vec<String>) -> Self { - Thread { id, msgs } - } - - pub fn id(&self) -> &String { - &self.id - } - - pub fn messages(&self) -> &Vec<String> { - &self.msgs - } -} |