diff options
author | Felix <me@nutomic.com> | 2020-05-16 16:04:08 +0200 |
---|---|---|
committer | Felix <me@nutomic.com> | 2020-05-16 20:04:17 +0200 |
commit | 9e61c3be94c623b43b2e87ed060bfebc041d1eaa (patch) | |
tree | f622a2e429363febf43e021038c67ae8d55dfb1d /server/src/websocket | |
parent | 3a4973ad68562f9ccb4a9f4442333e0478bc7b04 (diff) |
Rework imports
Diffstat (limited to 'server/src/websocket')
-rw-r--r-- | server/src/websocket/mod.rs | 12 | ||||
-rw-r--r-- | server/src/websocket/server.rs | 21 |
2 files changed, 19 insertions, 14 deletions
diff --git a/server/src/websocket/mod.rs b/server/src/websocket/mod.rs index fd200d7d..4eb43e49 100644 --- a/server/src/websocket/mod.rs +++ b/server/src/websocket/mod.rs @@ -2,16 +2,20 @@ pub mod server; use crate::ConnectionId; use actix::prelude::*; -use diesel::r2d2::{ConnectionManager, Pool}; -use diesel::PgConnection; +use diesel::{ + r2d2::{ConnectionManager, Pool}, + PgConnection, +}; use failure::Error; use log::{error, info}; use rand::{rngs::ThreadRng, Rng}; use serde::{Deserialize, Serialize}; use serde_json::Value; use server::ChatServer; -use std::collections::{HashMap, HashSet}; -use std::str::FromStr; +use std::{ + collections::{HashMap, HashSet}, + str::FromStr, +}; #[derive(EnumString, ToString, Debug, Clone)] pub enum UserOperation { diff --git a/server/src/websocket/server.rs b/server/src/websocket/server.rs index da5098e9..e4543ea1 100644 --- a/server/src/websocket/server.rs +++ b/server/src/websocket/server.rs @@ -3,15 +3,16 @@ //! room through `ChatServer`. use super::*; -use crate::api::comment::*; -use crate::api::community::*; -use crate::api::post::*; -use crate::api::site::*; -use crate::api::user::*; -use crate::api::*; -use crate::rate_limit::RateLimit; -use crate::websocket::UserOperation; -use crate::{CommunityId, ConnectionId, IPAddr, PostId, UserId}; +use crate::{ + api::{comment::*, community::*, post::*, site::*, user::*, *}, + rate_limit::RateLimit, + websocket::UserOperation, + CommunityId, + ConnectionId, + IPAddr, + PostId, + UserId, +}; /// Chat server sends this messages to session #[derive(Message)] @@ -940,7 +941,7 @@ impl Handler<Connect> for ChatServer { id, SessionInfo { addr: msg.addr, - ip: msg.ip.to_owned(), + ip: msg.ip, }, ); |