mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-26 01:40:33 +00:00
Group imports dess (#2526)
* Group imports with rustfmt * Running cargo fmt again. Co-authored-by: Felix Ableitner <me@nutomic.com>
This commit is contained in:
parent
28eade6168
commit
cb753b045f
32 changed files with 57 additions and 88 deletions
|
@ -2,4 +2,4 @@ tab_spaces = 2
|
|||
edition="2021"
|
||||
imports_layout="HorizontalVertical"
|
||||
imports_granularity="Crate"
|
||||
reorder_imports=true
|
||||
group_imports="One"
|
|
@ -1,3 +1,4 @@
|
|||
use crate::PerformCrud;
|
||||
use actix_web::web::Data;
|
||||
use lemmy_api_common::{
|
||||
comment::{CommentResponse, EditComment},
|
||||
|
@ -35,8 +36,6 @@ use lemmy_websocket::{
|
|||
UserOperationCrud,
|
||||
};
|
||||
|
||||
use crate::PerformCrud;
|
||||
|
||||
#[async_trait::async_trait(?Send)]
|
||||
impl PerformCrud for EditComment {
|
||||
type Response = CommentResponse;
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
use crate::{
|
||||
activities::{
|
||||
block::{generate_cc, SiteOrCommunity},
|
||||
community::{announce::GetCommunity, send_activity_in_community},
|
||||
generate_activity_id,
|
||||
send_lemmy_activity,
|
||||
verify_is_public,
|
||||
},
|
||||
activity_lists::AnnouncableActivities,
|
||||
local_instance,
|
||||
objects::{community::ApubCommunity, instance::remote_instance_inboxes, person::ApubPerson},
|
||||
protocol::activities::block::{block_user::BlockUser, undo_block_user::UndoBlockUser},
|
||||
ActorType,
|
||||
};
|
||||
use activitypub_federation::{
|
||||
core::object_id::ObjectId,
|
||||
data::Data,
|
||||
|
@ -18,21 +32,6 @@ use lemmy_utils::error::LemmyError;
|
|||
use lemmy_websocket::LemmyContext;
|
||||
use url::Url;
|
||||
|
||||
use crate::{
|
||||
activities::{
|
||||
block::{generate_cc, SiteOrCommunity},
|
||||
community::{announce::GetCommunity, send_activity_in_community},
|
||||
generate_activity_id,
|
||||
send_lemmy_activity,
|
||||
verify_is_public,
|
||||
},
|
||||
activity_lists::AnnouncableActivities,
|
||||
local_instance,
|
||||
objects::{community::ApubCommunity, instance::remote_instance_inboxes, person::ApubPerson},
|
||||
protocol::activities::block::{block_user::BlockUser, undo_block_user::UndoBlockUser},
|
||||
ActorType,
|
||||
};
|
||||
|
||||
impl UndoBlockUser {
|
||||
#[tracing::instrument(skip_all)]
|
||||
pub async fn send(
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
use crate::{
|
||||
objects::{comment::ApubComment, person::ApubPerson, post::ApubPost},
|
||||
protocol::activities::voting::vote::VoteType,
|
||||
};
|
||||
use lemmy_api_common::utils::blocking;
|
||||
use lemmy_db_schema::{
|
||||
source::{
|
||||
|
@ -13,11 +17,6 @@ use lemmy_websocket::{
|
|||
UserOperation,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
objects::{comment::ApubComment, person::ApubPerson, post::ApubPost},
|
||||
protocol::activities::voting::vote::VoteType,
|
||||
};
|
||||
|
||||
pub mod undo_vote;
|
||||
pub mod vote;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use lemmy_websocket::LemmyContext;
|
||||
|
||||
use crate::objects::community::ApubCommunity;
|
||||
use lemmy_websocket::LemmyContext;
|
||||
|
||||
pub(crate) mod community_moderators;
|
||||
pub(crate) mod community_outbox;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
use crate::newtypes::{CommentId, CommunityId, PersonId, PostId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::{
|
||||
comment_aggregates,
|
||||
|
@ -10,6 +8,7 @@ use crate::schema::{
|
|||
post_aggregates,
|
||||
site_aggregates,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
||||
|
|
|
@ -7,10 +7,9 @@ use crate::newtypes::{
|
|||
SiteId,
|
||||
SiteLanguageId,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::local_user_language;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
use crate::newtypes::{CommentId, DbUrl, LanguageId, LtreeDef, PersonId, PostId};
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::{comment, comment_like, comment_saved};
|
||||
use diesel_ltree::Ltree;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::{comment, comment_like, comment_saved};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
||||
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))]
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
use crate::newtypes::{CommentId, CommentReplyId, PersonId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::comment_reply;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
use crate::newtypes::{CommentId, CommentReportId, PersonId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::comment_report;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use crate::newtypes::{CommunityId, DbUrl, InstanceId, PersonId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::{community, community_follower, community_moderator, community_person_ban};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
use crate::newtypes::{CommunityBlockId, CommunityId, PersonId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::community_block;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use crate::newtypes::LocalUserId;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::email_verification;
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use crate::newtypes::InstanceId;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt::Debug;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::federation_allowlist;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt::Debug;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use crate::newtypes::InstanceId;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt::Debug;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::federation_blocklist;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt::Debug;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
use crate::newtypes::InstanceId;
|
||||
use std::fmt::Debug;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::instance;
|
||||
use std::fmt::Debug;
|
||||
|
||||
#[derive(PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
use crate::newtypes::LanguageId;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::language;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use crate::newtypes::{LocalSiteId, SiteId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::local_site;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use crate::newtypes::LocalSiteId;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::local_site_rate_limit;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use crate::newtypes::{LocalUserId, PersonId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::local_user;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
use crate::newtypes::{CommentId, CommunityId, PersonId, PostId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::{
|
||||
admin_purge_comment,
|
||||
|
@ -19,6 +17,7 @@ use crate::schema::{
|
|||
mod_sticky_post,
|
||||
mod_transfer_community,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use crate::newtypes::LocalUserId;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::password_reset_request;
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use crate::newtypes::{DbUrl, InstanceId, PersonId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::person;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
use crate::newtypes::{PersonBlockId, PersonId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::person_block;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
use crate::newtypes::{CommentId, PersonId, PersonMentionId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::person_mention;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use crate::newtypes::{CommunityId, DbUrl, LanguageId, PersonId, PostId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::{post, post_like, post_read, post_saved};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
use crate::newtypes::{DbUrl, PersonId, PostId, PostReportId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::post_report;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
|
||||
#[cfg_attr(feature = "full", derive(Identifiable, Queryable, Associations))]
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use crate::newtypes::{DbUrl, PersonId, PrivateMessageId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::private_message;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
use crate::newtypes::{PersonId, PrivateMessageId, PrivateMessageReportId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::private_message_report;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
use crate::newtypes::{LocalUserId, PersonId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::registration_application;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use crate::newtypes::{DbUrl, InstanceId, SiteId};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
use crate::schema::site;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typed_builder::TypedBuilder;
|
||||
|
||||
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use regex::RegexBuilder;
|
||||
|
||||
use crate::utils::{
|
||||
is_valid_actor_name,
|
||||
is_valid_display_name,
|
||||
|
@ -10,6 +8,7 @@ use crate::utils::{
|
|||
slur_check,
|
||||
slurs_vec_to_str,
|
||||
};
|
||||
use regex::RegexBuilder;
|
||||
|
||||
#[test]
|
||||
fn test_mentions_regex() {
|
||||
|
|
Loading…
Reference in a new issue