diff --git a/src/dispatcher.rs b/src/dispatcher.rs index b1c9ec1d2d..a26b037447 100644 --- a/src/dispatcher.rs +++ b/src/dispatcher.rs @@ -1,13 +1,13 @@ //! `Dispatcher` is a command dispatching actor that distributes commands to the appropriate //! actor for a given user. If an actor for that user is no longer active, it creates and //! initializes the actor before dispatching the command. -use std::sync::{Arc, Mutex, MutexGuard, RwLock}; use std::collections::HashMap; use std::io::{Error, ErrorKind}; +use std::sync::{Arc, Mutex, MutexGuard, RwLock}; -use actix::{Actor, Addr, Context, SyncContext, Handler, Message}; +use actix::{Actor, Addr, Context, Handler, Message, SyncContext}; -use db::models::{BSO, DBConfig, DBManager, PutBSO}; +use db::models::{DBConfig, DBManager, PutBSO, BSO}; use db::util::ms_since_epoch; // Messages that can be sent to the user diff --git a/src/handlers.rs b/src/handlers.rs index 3ae9a67867..d6361563a7 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -1,7 +1,7 @@ //! API Handlers use actix::{ActorResponse, Addr}; use actix_web::{ - error, Error, AsyncResponder, FromRequest, FutureResponse, HttpRequest, HttpResponse, Json, + error, AsyncResponder, Error, FromRequest, FutureResponse, HttpRequest, HttpResponse, Json, Path, Responder, State, }; use futures::Future; diff --git a/src/server/mod.rs b/src/server/mod.rs index 776fb306b9..86093d558b 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -3,8 +3,8 @@ #[cfg(test)] mod test; -use std::sync::{Arc, RwLock}; use std::collections::HashMap; +use std::sync::{Arc, RwLock}; use actix::{SyncArbiter, System, SystemRunner}; use actix_web::{http, middleware::cors::Cors, server::HttpServer, App}; @@ -24,8 +24,8 @@ impl Server { // Start dispatcher with the arbiter let db_pool = Arc::new(RwLock::new(HashMap::new())); - let db_executor = SyncArbiter::start(num_cpus::get(), move || { - DBExecutor { db_handles: db_pool.clone() } + let db_executor = SyncArbiter::start(num_cpus::get(), move || DBExecutor { + db_handles: db_pool.clone(), }); HttpServer::new(move || {