diff options
-rw-r--r-- | web/converse/src/db.rs | 26 | ||||
-rw-r--r-- | web/converse/src/errors.rs | 2 | ||||
-rw-r--r-- | web/converse/src/handlers.rs | 14 | ||||
-rw-r--r-- | web/converse/src/main.rs | 8 | ||||
-rw-r--r-- | web/converse/src/models.rs | 2 | ||||
-rw-r--r-- | web/converse/src/oidc.rs | 2 | ||||
-rw-r--r-- | web/converse/src/render.rs | 4 |
7 files changed, 29 insertions, 29 deletions
diff --git a/web/converse/src/db.rs b/web/converse/src/db.rs index e20349944402..1d61595898fa 100644 --- a/web/converse/src/db.rs +++ b/web/converse/src/db.rs @@ -23,8 +23,8 @@ use diesel::{self, sql_query}; use diesel::sql_types::Text; use diesel::prelude::*; use diesel::r2d2::{Pool, ConnectionManager}; -use models::*; -use errors::{ConverseError, Result}; +use crate::models::*; +use crate::errors::{ConverseError, Result}; /// The DB actor itself. Several of these will be run in parallel by /// `SyncArbiter`. @@ -43,7 +43,7 @@ impl Handler<ListThreads> for DbExecutor { type Result = <ListThreads as Message>::Result; fn handle(&mut self, _: ListThreads, _: &mut Self::Context) -> Self::Result { - use schema::thread_index::dsl::*; + use crate::schema::thread_index::dsl::*; let conn = self.0.get()?; let results = thread_index @@ -67,8 +67,8 @@ impl Handler<LookupOrCreateUser> for DbExecutor { fn handle(&mut self, msg: LookupOrCreateUser, _: &mut Self::Context) -> Self::Result { - use schema::users; - use schema::users::dsl::*; + use crate::schema::users; + use crate::schema::users::dsl::*; let conn = self.0.get()?; @@ -104,8 +104,8 @@ impl Handler<GetThread> for DbExecutor { type Result = <GetThread as Message>::Result; fn handle(&mut self, msg: GetThread, _: &mut Self::Context) -> Self::Result { - use schema::threads::dsl::*; - use schema::simple_posts::dsl::id; + use crate::schema::threads::dsl::*; + use crate::schema::simple_posts::dsl::id; let conn = self.0.get()?; let thread_result: Thread = threads @@ -129,7 +129,7 @@ impl Handler<GetPost> for DbExecutor { type Result = <GetPost as Message>::Result; fn handle(&mut self, msg: GetPost, _: &mut Self::Context) -> Self::Result { - use schema::simple_posts::dsl::*; + use crate::schema::simple_posts::dsl::*; let conn = self.0.get()?; Ok(simple_posts.find(msg.id).first(&conn)?) } @@ -148,7 +148,7 @@ impl Handler<UpdatePost> for DbExecutor { type Result = Result<Post>; fn handle(&mut self, msg: UpdatePost, _: &mut Self::Context) -> Self::Result { - use schema::posts::dsl::*; + use crate::schema::posts::dsl::*; let conn = self.0.get()?; let updated = diesel::update(posts.find(msg.post_id)) .set(body.eq(msg.post)) @@ -169,8 +169,8 @@ impl Handler<CreateThread> for DbExecutor { type Result = <CreateThread as Message>::Result; fn handle(&mut self, msg: CreateThread, _: &mut Self::Context) -> Self::Result { - use schema::threads; - use schema::posts; + use crate::schema::threads; + use crate::schema::posts; let conn = self.0.get()?; @@ -204,12 +204,12 @@ impl Handler<CreatePost> for DbExecutor { type Result = <CreatePost as Message>::Result; fn handle(&mut self, msg: CreatePost, _: &mut Self::Context) -> Self::Result { - use schema::posts; + use crate::schema::posts; let conn = self.0.get()?; let closed: bool = { - use schema::threads::dsl::*; + use crate::schema::threads::dsl::*; threads.select(closed) .find(msg.0.thread_id) .first(&conn)? diff --git a/web/converse/src/errors.rs b/web/converse/src/errors.rs index 95b2366ce509..6b22f8d39aa5 100644 --- a/web/converse/src/errors.rs +++ b/web/converse/src/errors.rs @@ -66,7 +66,7 @@ pub enum ConverseError { // actix-web-compatible response errors, such as the errors it // throws itself. #[fail(display = "Actix response error: {}", error)] - Actix { error: Box<ResponseError> }, + Actix { error: Box<dyn ResponseError> }, } // Establish conversion links to foreign errors: diff --git a/web/converse/src/handlers.rs b/web/converse/src/handlers.rs index d558afbe1242..d984fc71374b 100644 --- a/web/converse/src/handlers.rs +++ b/web/converse/src/handlers.rs @@ -29,15 +29,15 @@ use actix_web::http::Method; use actix_web::middleware::identity::RequestIdentity; use actix_web::middleware::{Started, Middleware}; use actix_web; -use db::*; -use errors::ConverseError; +use crate::db::*; +use crate::errors::ConverseError; use futures::Future; use mime_guess::guess_mime_type; -use models::*; -use oidc::*; -use render::*; +use crate::models::*; +use crate::oidc::*; +use crate::render::*; -type ConverseResponse = Box<Future<Item=HttpResponse, Error=ConverseError>>; +type ConverseResponse = Box<dyn Future<Item=HttpResponse, Error=ConverseError>>; const HTML: &'static str = "text/html"; const ANONYMOUS: i32 = 1; @@ -288,7 +288,7 @@ pub fn login(state: State<AppState>) -> ConverseResponse { /// otherwise a new user is created. pub fn callback(state: State<AppState>, data: Form<CodeResponse>, - mut req: HttpRequest<AppState>) -> ConverseResponse { + req: HttpRequest<AppState>) -> ConverseResponse { state.oidc.send(RetrieveToken(data.0)).flatten() .map(|author| LookupOrCreateUser { email: author.email, diff --git a/web/converse/src/main.rs b/web/converse/src/main.rs index 5c8a188fc31b..061cfa6e7baf 100644 --- a/web/converse/src/main.rs +++ b/web/converse/src/main.rs @@ -73,13 +73,13 @@ use actix_web::*; use actix_web::http::Method; use actix_web::middleware::Logger; use actix_web::middleware::identity::{IdentityService, CookieIdentityPolicy}; -use db::*; +use crate::db::*; use diesel::pg::PgConnection; use diesel::r2d2::{ConnectionManager, Pool}; -use handlers::*; -use oidc::OidcExecutor; +use crate::handlers::*; +use crate::oidc::OidcExecutor; use rand::{OsRng, Rng}; -use render::Renderer; +use crate::render::Renderer; use std::env; fn config(name: &str) -> String { diff --git a/web/converse/src/models.rs b/web/converse/src/models.rs index 96eed419d359..da628f78b5bc 100644 --- a/web/converse/src/models.rs +++ b/web/converse/src/models.rs @@ -17,7 +17,7 @@ // <https://www.gnu.org/licenses/>. use chrono::prelude::{DateTime, Utc}; -use schema::{users, threads, posts, simple_posts}; +use crate::schema::{users, threads, posts, simple_posts}; use diesel::sql_types::{Text, Integer}; /// Represents a single user in the Converse database. Converse does diff --git a/web/converse/src/oidc.rs b/web/converse/src/oidc.rs index 849143596895..baa6e626c0ac 100644 --- a/web/converse/src/oidc.rs +++ b/web/converse/src/oidc.rs @@ -26,7 +26,7 @@ use actix::prelude::*; use reqwest; use url::Url; use url_serde; -use errors::*; +use crate::errors::*; /// This structure represents the contents of an OIDC discovery /// document. diff --git a/web/converse/src/render.rs b/web/converse/src/render.rs index 025a369ba5b5..cfc08377a6fc 100644 --- a/web/converse/src/render.rs +++ b/web/converse/src/render.rs @@ -22,10 +22,10 @@ use actix::prelude::*; use askama::Template; -use errors::*; +use crate::errors::*; use std::fmt; use md5; -use models::*; +use crate::models::*; use chrono::prelude::{DateTime, Utc}; use comrak::{ComrakOptions, markdown_to_html}; |