diff --git a/plume-models/src/db_conn.rs b/plume-models/src/db_conn.rs index 169690a6..a44f5ecb 100644 --- a/plume-models/src/db_conn.rs +++ b/plume-models/src/db_conn.rs @@ -28,7 +28,7 @@ impl<'a, 'r> FromRequestAsync<'a, 'r> for DbConn { Box::pin(async move { match DbConn::from_request(request).await { Outcome::Success(a) => return Outcome::Success(a), - Outcome::Failure(_) => return Outcome::Failure((Status::ServiceUnavailable, ())), + _ => return Outcome::Failure((Status::ServiceUnavailable, ())), }; }) } diff --git a/plume-models/src/plume_rocket.rs b/plume-models/src/plume_rocket.rs index ca5f05df..7e297d0f 100644 --- a/plume-models/src/plume_rocket.rs +++ b/plume-models/src/plume_rocket.rs @@ -4,7 +4,7 @@ pub use self::module::PlumeRocket; mod module { use crate::{db_conn::DbConn, search, users}; use rocket::{ - request::{self, FlashMessage, FromRequest, FromRequestAsync, Request}, + request::{self, FlashMessage, FromRequestAsync, Request}, Outcome, State, }; use scheduled_thread_pool::ScheduledThreadPool; @@ -28,13 +28,13 @@ mod module { let conn = try_outcome!(DbConn::from_request(request).await); let intl = try_outcome!(rocket_i18n::I18n::from_request(request).await); let user = try_outcome!(users::User::from_request(request).await); - let worker = request.guard::<'_, State<'_, Arc>>()?; - let searcher = request.guard::<'_, State<'_, Arc>>()?; + let worker = try_outcome!(request.guard::<'_, State<'_, Arc>>()); + let searcher = try_outcome!(request.guard::<'_, State<'_, Arc>>()); let flash_msg = request.guard::>().succeeded(); Outcome::Success(PlumeRocket { conn, intl, - user, + user: Some(user), flash_msg: flash_msg.map(|f| (f.name().into(), f.msg().into())), worker: worker.clone(), searcher: searcher.clone(),