diff options
author | Vincent Ambo <mail@tazj.in> | 2022-02-07T15·49+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-02-08T12·06+0000 |
commit | 3d8ee620875085ae7e8d7ef31f4f8e3738cfdca1 (patch) | |
tree | c4597319495abbb82c9753791fbde11bfdb644f0 /web/converse/src/errors.rs | |
parent | 3318982f81c01b570b7021fd9f71aa2bfe192271 (diff) |
style(rust): Format all Rust code with rustfmt r/3791
Change-Id: Iab7e00cc26a4f9727d3ab98691ef379921a33052 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5240 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: grfn <grfn@gws.fyi> Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'web/converse/src/errors.rs')
-rw-r--r-- | web/converse/src/errors.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/web/converse/src/errors.rs b/web/converse/src/errors.rs index 32507c51b0c2..a4bd69023b8b 100644 --- a/web/converse/src/errors.rs +++ b/web/converse/src/errors.rs @@ -21,17 +21,12 @@ //! are established in a similar way as was tradition in //! `error_chain`, albeit manually. -use std::result; -use actix_web::{ResponseError, HttpResponse}; use actix_web::http::StatusCode; +use actix_web::{HttpResponse, ResponseError}; +use std::result; // Modules with foreign errors: -use actix; -use actix_web; -use askama; -use diesel; -use r2d2; -use tokio_timer; +use {actix, actix_web, askama, diesel, r2d2, tokio_timer}; pub type Result<T> = result::Result<T, ConverseError>; pub type ConverseResult<T> = result::Result<T, ConverseError>; @@ -96,7 +91,9 @@ impl From<askama::Error> for ConverseError { impl From<actix::MailboxError> for ConverseError { fn from(error: actix::MailboxError) -> ConverseError { - ConverseError::Actix { error: Box::new(error) } + ConverseError::Actix { + error: Box::new(error), + } } } @@ -136,7 +133,7 @@ impl ResponseError for ConverseError { .header("Location", format!("/thread/{}#post-reply", id)) .finish(), _ => HttpResponse::build(StatusCode::INTERNAL_SERVER_ERROR) - .body(format!("An error occured: {}", self)) + .body(format!("An error occured: {}", self)), } } } |