X-Git-Url: http://these/git/?a=blobdiff_plain;f=server%2Fsrc%2Fapi%2Fmod.rs;fp=server%2Fsrc%2Fapi%2Fmod.rs;h=afd62aff8011a524cb45e0b748fb96c3af8c5c81;hb=dc94e58cbf7e7de10d97331a3056380a3416e0b0;hp=4f11b3278e72bbbc8294b8bff49a9fc9710d557e;hpb=790b944031f9433be765936763d848ffa6e1b496;p=lemmy.git diff --git a/server/src/api/mod.rs b/server/src/api/mod.rs index 4f11b327..afd62aff 100644 --- a/server/src/api/mod.rs +++ b/server/src/api/mod.rs @@ -1,42 +1,12 @@ -use crate::db::category::*; -use crate::db::comment::*; -use crate::db::comment_view::*; -use crate::db::community::*; -use crate::db::community_view::*; -use crate::db::moderator::*; -use crate::db::moderator_views::*; -use crate::db::password_reset_request::*; -use crate::db::post::*; -use crate::db::post_view::*; -use crate::db::private_message::*; -use crate::db::private_message_view::*; -use crate::db::site::*; -use crate::db::site_view::*; -use crate::db::user::*; -use crate::db::user_mention::*; -use crate::db::user_mention_view::*; -use crate::db::user_view::*; -use crate::db::*; use crate::{ - extract_usernames, fetch_iframely_and_pictrs_data, generate_random_string, naive_from_unix, - naive_now, remove_slurs, send_email, slur_check, slurs_vec_to_str, + db::{community::*, community_view::*, moderator::*, site::*, user::*, user_view::*}, + websocket::WebsocketInfo, }; - -use crate::settings::Settings; -use crate::websocket::UserOperation; -use crate::websocket::{ - server::{ - JoinCommunityRoom, JoinPostRoom, JoinUserRoom, SendAllMessage, SendComment, - SendCommunityRoomMessage, SendPost, SendUserRoomMessage, - }, - WebsocketInfo, +use diesel::{ + r2d2::{ConnectionManager, Pool}, + PgConnection, }; -use diesel::r2d2::{ConnectionManager, Pool}; -use diesel::PgConnection; use failure::Error; -use log::{error, info}; -use serde::{Deserialize, Serialize}; -use std::str::FromStr; pub mod comment; pub mod community; @@ -62,8 +32,8 @@ pub struct Oper { data: T, } -impl Oper { - pub fn new(data: T) -> Oper { +impl Oper { + pub fn new(data: Data) -> Oper { Oper { data } } }