From: Dessalines Date: Wed, 16 Sep 2020 13:31:30 +0000 (-0500) Subject: Running cargo fmt. X-Git-Url: http://these/git/%22%7Burl%7D/%7B%60%24%7BghostArchiveUrl%7D/%7B%60/feeds/inbox/%7BlocalRss%7D?a=commitdiff_plain;h=96535366c3f4905171cfef66847222c1d6324fe7;p=lemmy.git Running cargo fmt. --- diff --git a/src/api/comment.rs b/src/api/comment.rs index 2f6a23b6..69853c3e 100644 --- a/src/api/comment.rs +++ b/src/api/comment.rs @@ -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}, diff --git a/src/api/community.rs b/src/api/community.rs index e16e7f71..77a945a6 100644 --- a/src/api/community.rs +++ b/src/api/community.rs @@ -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, diff --git a/src/api/mod.rs b/src/api/mod.rs index 0c66e7d7..d63f38eb 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -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; diff --git a/src/api/post.rs b/src/api/post.rs index 4cfb3bab..ef5409d1 100644 --- a/src/api/post.rs +++ b/src/api/post.rs @@ -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}, diff --git a/src/api/site.rs b/src/api/site.rs index 4d6438a1..3ff1e49d 100644 --- a/src/api/site.rs +++ b/src/api/site.rs @@ -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, diff --git a/src/api/user.rs b/src/api/user.rs index 3301be9d..630f816d 100644 --- a/src/api/user.rs +++ b/src/api/user.rs @@ -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, diff --git a/src/apub/comment.rs b/src/apub/comment.rs index e71eeacd..fc19ec33 100644 --- a/src/apub/comment.rs +++ b/src/apub/comment.rs @@ -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}, diff --git a/src/apub/community.rs b/src/apub/community.rs index 8a11f570..54b2957e 100644 --- a/src/apub/community.rs +++ b/src/apub/community.rs @@ -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, diff --git a/src/apub/fetcher.rs b/src/apub/fetcher.rs index c1caa039..5d772f06 100644 --- a/src/apub/fetcher.rs +++ b/src/apub/fetcher.rs @@ -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; diff --git a/src/apub/inbox/activities/create.rs b/src/apub/inbox/activities/create.rs index d54834e1..961991a6 100644 --- a/src/apub/inbox/activities/create.rs +++ b/src/apub/inbox/activities/create.rs @@ -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( diff --git a/src/apub/inbox/activities/delete.rs b/src/apub/inbox/activities/delete.rs index 41615132..131588ba 100644 --- a/src/apub/inbox/activities/delete.rs +++ b/src/apub/inbox/activities/delete.rs @@ -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( diff --git a/src/apub/inbox/activities/dislike.rs b/src/apub/inbox/activities/dislike.rs index 07bf0815..df9bd848 100644 --- a/src/apub/inbox/activities/dislike.rs +++ b/src/apub/inbox/activities/dislike.rs @@ -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( diff --git a/src/apub/inbox/activities/like.rs b/src/apub/inbox/activities/like.rs index dbb6363d..ce067c87 100644 --- a/src/apub/inbox/activities/like.rs +++ b/src/apub/inbox/activities/like.rs @@ -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( diff --git a/src/apub/inbox/activities/remove.rs b/src/apub/inbox/activities/remove.rs index 3299d5cf..e91a65c0 100644 --- a/src/apub/inbox/activities/remove.rs +++ b/src/apub/inbox/activities/remove.rs @@ -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( diff --git a/src/apub/inbox/activities/undo.rs b/src/apub/inbox/activities/undo.rs index c3dad420..c8b4d35b 100644 --- a/src/apub/inbox/activities/undo.rs +++ b/src/apub/inbox/activities/undo.rs @@ -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( diff --git a/src/apub/inbox/activities/update.rs b/src/apub/inbox/activities/update.rs index 137dc061..ccf7534b 100644 --- a/src/apub/inbox/activities/update.rs +++ b/src/apub/inbox/activities/update.rs @@ -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( diff --git a/src/apub/inbox/community_inbox.rs b/src/apub/inbox/community_inbox.rs index e60c3fe7..9dd010c3 100644 --- a/src/apub/inbox/community_inbox.rs +++ b/src/apub/inbox/community_inbox.rs @@ -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}; diff --git a/src/apub/inbox/user_inbox.rs b/src/apub/inbox/user_inbox.rs index cf47a597..5cbbedb6 100644 --- a/src/apub/inbox/user_inbox.rs +++ b/src/apub/inbox/user_inbox.rs @@ -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}; diff --git a/src/apub/mod.rs b/src/apub/mod.rs index db489622..5fd5da36 100644 --- a/src/apub/mod.rs +++ b/src/apub/mod.rs @@ -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, diff --git a/src/apub/post.rs b/src/apub/post.rs index d2fa7dc5..85e00fb2 100644 --- a/src/apub/post.rs +++ b/src/apub/post.rs @@ -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}, diff --git a/src/apub/private_message.rs b/src/apub/private_message.rs index 00196bfd..9e0549ee 100644 --- a/src/apub/private_message.rs +++ b/src/apub/private_message.rs @@ -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; diff --git a/src/apub/user.rs b/src/apub/user.rs index 5bd6d257..fb650632 100644 --- a/src/apub/user.rs +++ b/src/apub/user.rs @@ -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}, diff --git a/src/main.rs b/src/main.rs index 39ab014d..800196cf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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; diff --git a/src/routes/api.rs b/src/routes/api.rs index fffb7cdf..7e019168 100644 --- a/src/routes/api.rs +++ b/src/routes/api.rs @@ -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) { diff --git a/src/routes/feeds.rs b/src/routes/feeds.rs index c73b8e05..9669bfcc 100644 --- a/src/routes/feeds.rs +++ b/src/routes/feeds.rs @@ -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; diff --git a/src/routes/nodeinfo.rs b/src/routes/nodeinfo.rs index 20e55cca..15c5a235 100644 --- a/src/routes/nodeinfo.rs +++ b/src/routes/nodeinfo.rs @@ -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; diff --git a/src/routes/webfinger.rs b/src/routes/webfinger.rs index 1ea38867..53a87b12 100644 --- a/src/routes/webfinger.rs +++ b/src/routes/webfinger.rs @@ -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, diff --git a/src/websocket/chat_server.rs b/src/websocket/chat_server.rs index 13106d9d..0c4dfb0b 100644 --- a/src/websocket/chat_server.rs +++ b/src/websocket/chat_server.rs @@ -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, diff --git a/src/websocket/handlers.rs b/src/websocket/handlers.rs index b3c8d541..75e638f9 100644 --- a/src/websocket/handlers.rs +++ b/src/websocket/handlers.rs @@ -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;