diff options
author | Alex Auvolat <alex@adnab.me> | 2022-06-30 14:02:57 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-06-30 14:03:12 +0200 |
commit | b15026ec9ca2045f7ddb21a759cb075bb1dbd014 (patch) | |
tree | 3caab71bf46f299df407b447be46398967a3c68d /src/imap/flow.rs | |
parent | 89b588338700d13e34b50836cb790c0e0d588a28 (diff) | |
download | aerogramme-b15026ec9ca2045f7ddb21a759cb075bb1dbd014.tar.gz aerogramme-b15026ec9ca2045f7ddb21a759cb075bb1dbd014.zip |
Refactor user to be shared using Arc
Diffstat (limited to 'src/imap/flow.rs')
-rw-r--r-- | src/imap/flow.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/imap/flow.rs b/src/imap/flow.rs index feb78ac..303b498 100644 --- a/src/imap/flow.rs +++ b/src/imap/flow.rs @@ -1,5 +1,6 @@ use std::error::Error as StdError; use std::fmt; +use std::sync::Arc; use crate::imap::mailbox_view::MailboxView; use crate::mail::user::User; @@ -17,16 +18,16 @@ impl StdError for Error {} pub enum State { NotAuthenticated, - Authenticated(User), - Selected(User, MailboxView), + Authenticated(Arc<User>), + Selected(Arc<User>, MailboxView), // Examined is like Selected, but indicates that the mailbox is read-only - Examined(User, MailboxView), + Examined(Arc<User>, MailboxView), Logout, } pub enum Transition { None, - Authenticate(User), + Authenticate(Arc<User>), Examine(MailboxView), Select(MailboxView), Unselect, |