summaryrefslogtreecommitdiffstats
path: root/ui/src/components/mail/view
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-07-28 18:52:45 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-07-28 20:15:41 +0300
commit8a0e702127bc6229cad363918ae7542b26c11317 (patch)
tree20dd37642c21e2d634c512496c33b2ca5761dce9 /ui/src/components/mail/view
parent5b679be782e4930be393654c1a3095422bcf242e (diff)
melib,ui: add MailboxEntry enum
Use an enum to describe a mailbox's state in ui::conf::Account instead of Result.
Diffstat (limited to 'ui/src/components/mail/view')
-rw-r--r--ui/src/components/mail/view/thread.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/src/components/mail/view/thread.rs b/ui/src/components/mail/view/thread.rs
index ed6936bb..daf22102 100644
--- a/ui/src/components/mail/view/thread.rs
+++ b/ui/src/components/mail/view/thread.rs
@@ -158,7 +158,7 @@ impl ThreadView {
fn initiate(&mut self, expanded_hash: Option<ThreadHash>, context: &Context) {
/* stack to push thread messages in order in order to pop and print them later */
let account = &context.accounts[self.coordinates.0];
- let mailbox = &account[self.coordinates.1].as_ref().unwrap();
+ let mailbox = &account[self.coordinates.1].unwrap();
let threads = &account.collection.threads[&mailbox.folder.hash()];
let thread_iter = threads.thread_iter(self.coordinates.2);
@@ -607,7 +607,7 @@ impl ThreadView {
/* First draw the thread subject on the first row */
let y = if self.dirty {
let account = &context.accounts[self.coordinates.0];
- let mailbox = &account[self.coordinates.1].as_ref().unwrap();
+ let mailbox = &account[self.coordinates.1].unwrap();
let threads = &account.collection.threads[&mailbox.folder.hash()];
let thread_node = &threads.thread_nodes()[&threads.root_set(self.coordinates.2)];
let i = if let Some(i) = thread_node.message() {
@@ -688,7 +688,7 @@ impl ThreadView {
/* First draw the thread subject on the first row */
let y = {
let account = &context.accounts[self.coordinates.0];
- let mailbox = &account[self.coordinates.1].as_ref().unwrap();
+ let mailbox = &account[self.coordinates.1].unwrap();
let threads = &account.collection.threads[&mailbox.folder.hash()];
let thread_node = &threads.thread_nodes()[&threads.root_set(self.coordinates.2)];
let i = if let Some(i) = thread_node.message() {
@@ -904,7 +904,7 @@ impl Component for ThreadView {
UIEvent::Input(Key::Char('e')) => {
{
let account = &context.accounts[self.coordinates.0];
- let mailbox = &account[self.coordinates.1].as_ref().unwrap();
+ let mailbox = &account[self.coordinates.1].unwrap();
let threads = &account.collection.threads[&mailbox.folder.hash()];
let thread_node =
&threads.thread_nodes()[&threads.root_set(self.coordinates.2)];