Running cargo fmt.

This commit is contained in:
Dessalines 2020-09-16 08:31:30 -05:00
parent 3fbc8b130d
commit 96535366c3
29 changed files with 106 additions and 106 deletions

View file

@ -11,12 +11,6 @@ use crate::{
LemmyContext,
};
use actix_web::web::Data;
use lemmy_structs::{
blocking,
comment::*,
send_local_notifs,
websocket::{SendComment, UserOperation},
};
use lemmy_db::{
comment::*,
comment_view::*,
@ -30,6 +24,12 @@ use lemmy_db::{
Saveable,
SortType,
};
use lemmy_structs::{
blocking,
comment::*,
send_local_notifs,
websocket::{SendComment, UserOperation},
};
use lemmy_utils::{
apub::{make_apub_endpoint, EndpointType},
utils::{remove_slurs, scrape_text_for_mentions},

View file

@ -5,16 +5,6 @@ use crate::{
};
use actix_web::web::Data;
use anyhow::Context;
use lemmy_structs::{
blocking,
community::*,
websocket::{
GetCommunityUsersOnline,
JoinCommunityRoom,
SendCommunityRoomMessage,
UserOperation,
},
};
use lemmy_db::{
comment::Comment,
comment_view::CommentQueryBuilder,
@ -32,6 +22,16 @@ use lemmy_db::{
Joinable,
SortType,
};
use lemmy_structs::{
blocking,
community::*,
websocket::{
GetCommunityUsersOnline,
JoinCommunityRoom,
SendCommunityRoomMessage,
UserOperation,
},
};
use lemmy_utils::{
apub::{generate_actor_keypair, make_apub_endpoint, EndpointType},
location_info,

View file

@ -1,6 +1,5 @@
use crate::{api::claims::Claims, DbPool, LemmyContext};
use actix_web::web::Data;
use lemmy_structs::blocking;
use lemmy_db::{
community::Community,
community_view::CommunityUserBanView,
@ -8,6 +7,7 @@ use lemmy_db::{
user::User_,
Crud,
};
use lemmy_structs::blocking;
use lemmy_utils::{APIError, ConnectionId, LemmyError};
pub mod claims;

View file

@ -5,11 +5,6 @@ use crate::{
LemmyContext,
};
use actix_web::web::Data;
use lemmy_structs::{
blocking,
post::*,
websocket::{GetPostUsersOnline, JoinPostRoom, SendPost, UserOperation},
};
use lemmy_db::{
comment_view::*,
community_view::*,
@ -24,6 +19,11 @@ use lemmy_db::{
Saveable,
SortType,
};
use lemmy_structs::{
blocking,
post::*,
websocket::{GetPostUsersOnline, JoinPostRoom, SendPost, UserOperation},
};
use lemmy_utils::{
apub::{make_apub_endpoint, EndpointType},
utils::{check_slurs, check_slurs_opt, is_valid_post_title},

View file

@ -6,12 +6,6 @@ use crate::{
};
use actix_web::web::Data;
use anyhow::Context;
use lemmy_structs::{
blocking,
site::*,
user::Register,
websocket::{GetUsersOnline, SendAllMessage, UserOperation},
};
use lemmy_db::{
category::*,
comment_view::*,
@ -28,6 +22,12 @@ use lemmy_db::{
SearchType,
SortType,
};
use lemmy_structs::{
blocking,
site::*,
user::Register,
websocket::{GetUsersOnline, SendAllMessage, UserOperation},
};
use lemmy_utils::{
location_info,
settings::Settings,

View file

@ -9,18 +9,6 @@ use anyhow::Context;
use bcrypt::verify;
use captcha::{gen, Difficulty};
use chrono::Duration;
use lemmy_structs::{
blocking,
user::*,
websocket::{
CaptchaItem,
CheckCaptcha,
JoinUserRoom,
SendAllMessage,
SendUserRoomMessage,
UserOperation,
},
};
use lemmy_db::{
comment::*,
comment_view::*,
@ -46,6 +34,18 @@ use lemmy_db::{
ListingType,
SortType,
};
use lemmy_structs::{
blocking,
user::*,
websocket::{
CaptchaItem,
CheckCaptcha,
JoinUserRoom,
SendAllMessage,
SendUserRoomMessage,
UserOperation,
},
};
use lemmy_utils::{
apub::{generate_actor_keypair, make_apub_endpoint, EndpointType},
email::send_email,

View file

@ -40,7 +40,6 @@ use activitystreams::{
use actix_web::{body::Body, web, web::Path, HttpResponse};
use anyhow::Context;
use itertools::Itertools;
use lemmy_structs::blocking;
use lemmy_db::{
comment::{Comment, CommentForm},
community::Community,
@ -48,6 +47,7 @@ use lemmy_db::{
user::User_,
Crud,
};
use lemmy_structs::blocking;
use lemmy_utils::{
location_info,
utils::{convert_datetime, remove_slurs, scrape_text_for_mentions, MentionData},

View file

@ -38,7 +38,6 @@ use activitystreams_ext::Ext2;
use actix_web::{body::Body, web, HttpResponse};
use anyhow::Context;
use itertools::Itertools;
use lemmy_structs::blocking;
use lemmy_db::{
community::{Community, CommunityForm},
community_view::{CommunityFollowerView, CommunityModeratorView},
@ -46,6 +45,7 @@ use lemmy_db::{
post::Post,
user::User_,
};
use lemmy_structs::blocking;
use lemmy_utils::{
apub::get_apub_protocol_string,
location_info,

View file

@ -15,7 +15,6 @@ use activitystreams::{base::BaseExt, collection::OrderedCollection, object::Note
use anyhow::{anyhow, Context};
use chrono::NaiveDateTime;
use diesel::result::Error::NotFound;
use lemmy_structs::{blocking, site::SearchResponse};
use lemmy_db::{
comment::{Comment, CommentForm},
comment_view::CommentView,
@ -30,6 +29,7 @@ use lemmy_db::{
Joinable,
SearchType,
};
use lemmy_structs::{blocking, site::SearchResponse};
use lemmy_utils::{apub::get_apub_protocol_string, location_info, LemmyError};
use log::debug;
use reqwest::Client;

View file

@ -14,6 +14,12 @@ use crate::{
use activitystreams::{activity::Create, base::AnyBase, object::Note, prelude::*};
use actix_web::HttpResponse;
use anyhow::Context;
use lemmy_db::{
comment::{Comment, CommentForm},
comment_view::CommentView,
post::{Post, PostForm},
post_view::PostView,
};
use lemmy_structs::{
blocking,
comment::CommentResponse,
@ -21,12 +27,6 @@ use lemmy_structs::{
send_local_notifs,
websocket::{SendComment, SendPost, UserOperation},
};
use lemmy_db::{
comment::{Comment, CommentForm},
comment_view::CommentView,
post::{Post, PostForm},
post_view::PostView,
};
use lemmy_utils::{location_info, utils::scrape_text_for_mentions, LemmyError};
pub async fn receive_create(

View file

@ -16,13 +16,6 @@ use crate::{
use activitystreams::{activity::Delete, base::AnyBase, object::Note, prelude::*};
use actix_web::HttpResponse;
use anyhow::Context;
use lemmy_structs::{
blocking,
comment::CommentResponse,
community::CommunityResponse,
post::PostResponse,
websocket::{SendComment, SendCommunityRoomMessage, SendPost, UserOperation},
};
use lemmy_db::{
comment::{Comment, CommentForm},
comment_view::CommentView,
@ -33,6 +26,13 @@ use lemmy_db::{
post_view::PostView,
Crud,
};
use lemmy_structs::{
blocking,
comment::CommentResponse,
community::CommunityResponse,
post::PostResponse,
websocket::{SendComment, SendCommunityRoomMessage, SendPost, UserOperation},
};
use lemmy_utils::{location_info, LemmyError};
pub async fn receive_delete(

View file

@ -14,12 +14,6 @@ use crate::{
use activitystreams::{activity::Dislike, base::AnyBase, object::Note, prelude::*};
use actix_web::HttpResponse;
use anyhow::Context;
use lemmy_structs::{
blocking,
comment::CommentResponse,
post::PostResponse,
websocket::{SendComment, SendPost, UserOperation},
};
use lemmy_db::{
comment::{CommentForm, CommentLike, CommentLikeForm},
comment_view::CommentView,
@ -27,6 +21,12 @@ use lemmy_db::{
post_view::PostView,
Likeable,
};
use lemmy_structs::{
blocking,
comment::CommentResponse,
post::PostResponse,
websocket::{SendComment, SendPost, UserOperation},
};
use lemmy_utils::{location_info, LemmyError};
pub async fn receive_dislike(

View file

@ -14,12 +14,6 @@ use crate::{
use activitystreams::{activity::Like, base::AnyBase, object::Note, prelude::*};
use actix_web::HttpResponse;
use anyhow::Context;
use lemmy_structs::{
blocking,
comment::CommentResponse,
post::PostResponse,
websocket::{SendComment, SendPost, UserOperation},
};
use lemmy_db::{
comment::{CommentForm, CommentLike, CommentLikeForm},
comment_view::CommentView,
@ -27,6 +21,12 @@ use lemmy_db::{
post_view::PostView,
Likeable,
};
use lemmy_structs::{
blocking,
comment::CommentResponse,
post::PostResponse,
websocket::{SendComment, SendPost, UserOperation},
};
use lemmy_utils::{location_info, LemmyError};
pub async fn receive_like(

View file

@ -17,13 +17,6 @@ use crate::{
use activitystreams::{activity::Remove, base::AnyBase, object::Note, prelude::*};
use actix_web::HttpResponse;
use anyhow::{anyhow, Context};
use lemmy_structs::{
blocking,
comment::CommentResponse,
community::CommunityResponse,
post::PostResponse,
websocket::{SendComment, SendCommunityRoomMessage, SendPost, UserOperation},
};
use lemmy_db::{
comment::{Comment, CommentForm},
comment_view::CommentView,
@ -34,6 +27,13 @@ use lemmy_db::{
post_view::PostView,
Crud,
};
use lemmy_structs::{
blocking,
comment::CommentResponse,
community::CommunityResponse,
post::PostResponse,
websocket::{SendComment, SendCommunityRoomMessage, SendPost, UserOperation},
};
use lemmy_utils::{location_info, LemmyError};
pub async fn receive_remove(

View file

@ -21,13 +21,6 @@ use activitystreams::{
};
use actix_web::HttpResponse;
use anyhow::{anyhow, Context};
use lemmy_structs::{
blocking,
comment::CommentResponse,
community::CommunityResponse,
post::PostResponse,
websocket::{SendComment, SendCommunityRoomMessage, SendPost, UserOperation},
};
use lemmy_db::{
comment::{Comment, CommentForm, CommentLike},
comment_view::CommentView,
@ -39,6 +32,13 @@ use lemmy_db::{
Crud,
Likeable,
};
use lemmy_structs::{
blocking,
comment::CommentResponse,
community::CommunityResponse,
post::PostResponse,
websocket::{SendComment, SendCommunityRoomMessage, SendPost, UserOperation},
};
use lemmy_utils::{location_info, LemmyError};
pub async fn receive_undo(

View file

@ -15,13 +15,6 @@ use crate::{
use activitystreams::{activity::Update, base::AnyBase, object::Note, prelude::*};
use actix_web::HttpResponse;
use anyhow::Context;
use lemmy_structs::{
blocking,
comment::CommentResponse,
post::PostResponse,
send_local_notifs,
websocket::{SendComment, SendPost, UserOperation},
};
use lemmy_db::{
comment::{Comment, CommentForm},
comment_view::CommentView,
@ -29,6 +22,13 @@ use lemmy_db::{
post_view::PostView,
Crud,
};
use lemmy_structs::{
blocking,
comment::CommentResponse,
post::PostResponse,
send_local_notifs,
websocket::{SendComment, SendPost, UserOperation},
};
use lemmy_utils::{location_info, utils::scrape_text_for_mentions, LemmyError};
pub async fn receive_update(

View file

@ -15,12 +15,12 @@ use activitystreams::{
};
use actix_web::{web, HttpRequest, HttpResponse};
use anyhow::{anyhow, Context};
use lemmy_structs::blocking;
use lemmy_db::{
community::{Community, CommunityFollower, CommunityFollowerForm},
user::User_,
Followable,
};
use lemmy_structs::blocking;
use lemmy_utils::{location_info, LemmyError};
use log::debug;
use serde::{Deserialize, Serialize};

View file

@ -16,11 +16,6 @@ use activitystreams::{
};
use actix_web::{web, HttpRequest, HttpResponse};
use anyhow::Context;
use lemmy_structs::{
blocking,
user::PrivateMessageResponse,
websocket::{SendUserRoomMessage, UserOperation},
};
use lemmy_db::{
community::{CommunityFollower, CommunityFollowerForm},
naive_now,
@ -30,6 +25,11 @@ use lemmy_db::{
Crud,
Followable,
};
use lemmy_structs::{
blocking,
user::PrivateMessageResponse,
websocket::{SendUserRoomMessage, UserOperation},
};
use lemmy_utils::{location_info, LemmyError};
use log::debug;
use serde::{Deserialize, Serialize};

View file

@ -32,8 +32,8 @@ use activitystreams_ext::{Ext1, Ext2};
use actix_web::{body::Body, HttpResponse};
use anyhow::{anyhow, Context};
use chrono::NaiveDateTime;
use lemmy_structs::blocking;
use lemmy_db::{activity::do_insert_activity, user::User_};
use lemmy_structs::blocking;
use lemmy_utils::{
apub::get_apub_protocol_string,
location_info,

View file

@ -35,13 +35,13 @@ use activitystreams::{
use activitystreams_ext::Ext1;
use actix_web::{body::Body, web, HttpResponse};
use anyhow::Context;
use lemmy_structs::blocking;
use lemmy_db::{
community::Community,
post::{Post, PostForm},
user::User_,
Crud,
};
use lemmy_structs::blocking;
use lemmy_utils::{
location_info,
utils::{check_slurs, convert_datetime, remove_slurs},

View file

@ -27,12 +27,12 @@ use activitystreams::{
prelude::*,
};
use anyhow::Context;
use lemmy_structs::blocking;
use lemmy_db::{
private_message::{PrivateMessage, PrivateMessageForm},
user::User_,
Crud,
};
use lemmy_structs::blocking;
use lemmy_utils::{location_info, utils::convert_datetime, LemmyError};
use url::Url;

View file

@ -27,11 +27,11 @@ use activitystreams::{
use activitystreams_ext::Ext1;
use actix_web::{body::Body, web, HttpResponse};
use anyhow::Context;
use lemmy_structs::blocking;
use lemmy_db::{
naive_now,
user::{UserForm, User_},
};
use lemmy_structs::blocking;
use lemmy_utils::{
location_info,
utils::{check_slurs, check_slurs_opt, convert_datetime},

View file

@ -16,7 +16,6 @@ use diesel::{
PgConnection,
};
use lazy_static::lazy_static;
use lemmy_structs::blocking;
use lemmy_db::get_database_url_from_env;
use lemmy_rate_limit::{rate_limiter::RateLimiter, RateLimit};
use lemmy_server::{
@ -26,6 +25,7 @@ use lemmy_server::{
websocket::chat_server::ChatServer,
LemmyContext,
};
use lemmy_structs::blocking;
use lemmy_utils::{settings::Settings, LemmyError, CACHE_CONTROL_REGEX};
use reqwest::Client;
use std::sync::Arc;

View file

@ -1,7 +1,7 @@
use crate::{api::Perform, LemmyContext};
use actix_web::{error::ErrorBadRequest, *};
use lemmy_structs::{comment::*, community::*, post::*, site::*, user::*};
use lemmy_rate_limit::RateLimit;
use lemmy_structs::{comment::*, community::*, post::*, site::*, user::*};
use serde::Deserialize;
pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimit) {

View file

@ -3,7 +3,6 @@ use actix_web::{error::ErrorBadRequest, *};
use anyhow::anyhow;
use chrono::{DateTime, NaiveDateTime, Utc};
use diesel::PgConnection;
use lemmy_structs::blocking;
use lemmy_db::{
comment_view::{ReplyQueryBuilder, ReplyView},
community::Community,
@ -14,6 +13,7 @@ use lemmy_db::{
ListingType,
SortType,
};
use lemmy_structs::blocking;
use lemmy_utils::{settings::Settings, utils::markdown_to_html, LemmyError};
use rss::{CategoryBuilder, ChannelBuilder, GuidBuilder, Item, ItemBuilder};
use serde::Deserialize;

View file

@ -1,8 +1,8 @@
use crate::{version, LemmyContext};
use actix_web::{body::Body, error::ErrorBadRequest, *};
use anyhow::anyhow;
use lemmy_structs::blocking;
use lemmy_db::site_view::SiteView;
use lemmy_structs::blocking;
use lemmy_utils::{apub::get_apub_protocol_string, settings::Settings, LemmyError};
use serde::{Deserialize, Serialize};
use url::Url;

View file

@ -1,8 +1,8 @@
use crate::LemmyContext;
use actix_web::{error::ErrorBadRequest, web::Query, *};
use anyhow::anyhow;
use lemmy_structs::blocking;
use lemmy_db::{community::Community, user::User_};
use lemmy_structs::blocking;
use lemmy_utils::{
settings::Settings,
LemmyError,

View file

@ -9,8 +9,8 @@ use diesel::{
r2d2::{ConnectionManager, Pool},
PgConnection,
};
use lemmy_structs::{comment::*, community::*, post::*, site::*, user::*, websocket::*};
use lemmy_rate_limit::RateLimit;
use lemmy_structs::{comment::*, community::*, post::*, site::*, user::*, websocket::*};
use lemmy_utils::{
location_info,
APIError,

View file

@ -5,9 +5,9 @@ use crate::{
};
use actix::{Actor, Context, Handler, ResponseFuture};
use actix_web::web;
use lemmy_structs::websocket::*;
use lemmy_db::naive_now;
use lemmy_rate_limit::RateLimit;
use lemmy_structs::websocket::*;
use lemmy_utils::{ConnectionId, IPAddr, LemmyError};
use log::{error, info};
use rand::Rng;