From b15026ec9ca2045f7ddb21a759cb075bb1dbd014 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 30 Jun 2022 14:02:57 +0200 Subject: Refactor user to be shared using Arc --- src/imap/command/authenticated.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/imap/command/authenticated.rs') diff --git a/src/imap/command/authenticated.rs b/src/imap/command/authenticated.rs index dfcb52e..0b34223 100644 --- a/src/imap/command/authenticated.rs +++ b/src/imap/command/authenticated.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use anyhow::Result; use boitalettres::proto::{Request, Response}; use imap_codec::types::command::{CommandBody, StatusAttribute}; @@ -12,7 +14,7 @@ use crate::mail::user::User; pub struct AuthenticatedContext<'a> { pub req: &'a Request, - pub user: &'a User, + pub user: &'a Arc, } pub async fn dispatch<'a>(ctx: AuthenticatedContext<'a>) -> Result<(Response, flow::Transition)> { -- cgit v1.2.3