]> Untitled Git - lemmy.git/commitdiff
Group imports dess (#2526)
authorDessalines <dessalines@users.noreply.github.com>
Wed, 2 Nov 2022 19:18:22 +0000 (15:18 -0400)
committerGitHub <noreply@github.com>
Wed, 2 Nov 2022 19:18:22 +0000 (15:18 -0400)
* Group imports with rustfmt

* Running cargo fmt again.

Co-authored-by: Felix Ableitner <me@nutomic.com>
32 files changed:
.rustfmt.toml
crates/api_crud/src/comment/update.rs
crates/apub/src/activities/block/undo_block_user.rs
crates/apub/src/activities/voting/mod.rs
crates/apub/src/collections/mod.rs
crates/db_schema/src/aggregates/structs.rs
crates/db_schema/src/source/actor_language.rs
crates/db_schema/src/source/comment.rs
crates/db_schema/src/source/comment_reply.rs
crates/db_schema/src/source/comment_report.rs
crates/db_schema/src/source/community.rs
crates/db_schema/src/source/community_block.rs
crates/db_schema/src/source/email_verification.rs
crates/db_schema/src/source/federation_allowlist.rs
crates/db_schema/src/source/federation_blocklist.rs
crates/db_schema/src/source/instance.rs
crates/db_schema/src/source/language.rs
crates/db_schema/src/source/local_site.rs
crates/db_schema/src/source/local_site_rate_limit.rs
crates/db_schema/src/source/local_user.rs
crates/db_schema/src/source/moderator.rs
crates/db_schema/src/source/password_reset_request.rs
crates/db_schema/src/source/person.rs
crates/db_schema/src/source/person_block.rs
crates/db_schema/src/source/person_mention.rs
crates/db_schema/src/source/post.rs
crates/db_schema/src/source/post_report.rs
crates/db_schema/src/source/private_message.rs
crates/db_schema/src/source/private_message_report.rs
crates/db_schema/src/source/registration_application.rs
crates/db_schema/src/source/site.rs
crates/utils/src/test.rs

index 6bf5e0edaaa7c4d270e99fa32b344c433363db34..c539ff0b4d4a0c22364d19be8c5182a83ad3ae02 100644 (file)
@@ -2,4 +2,4 @@ tab_spaces = 2
 edition="2021"
 imports_layout="HorizontalVertical"
 imports_granularity="Crate"
-reorder_imports=true
+group_imports="One"
\ No newline at end of file
index f9a18fb3063c911bf601162f9f47765d4ff6aa53..9678765e90f203d44cc1663ed0ab439382f5b222 100644 (file)
@@ -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;
index 6de1d3a17c46abc1ba4b03cd5d24b7e76f27167e..cd9784f3213b6962726f7399b5626a9268c1263b 100644 (file)
@@ -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(
index 4896b4c64733139c3e56402bd88237e8df11f2e4..6744e1c5f5c949e4bd52c14cd7ad9b6544096f8e 100644 (file)
@@ -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;
 
index a2e77d1bc70d289e551ad6ee7e3ede5dbba74785..e2a274a01ee24328d69adf14b6231b54ac09e6a0 100644 (file)
@@ -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;
index ab87f4580086861d8c4ba11c5d88ec40965ef914..0cc4dd05ec388ca60d3560221bc7b5ca3344b540 100644 (file)
@@ -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))]
index 8831791e4130fe8546d56f1381cae96433c17b8a..6780be51bcc9f2de1911eca31a4d18f0617af0df 100644 (file)
@@ -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))]
index 5b7ab085b6275e5d2241a14be4626b57fb925b25..ed520f1dff9b03803422a3a0b87fe90da3038c5b 100644 (file)
@@ -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)))]
index 8b7fe51b027252fece2a43773f8dcc0da76df44d..bcce607ed49d241d446bb787e9943f1d29e7480c 100644 (file)
@@ -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))]
index 6cc328d0de29f4d4adf6ba2c4288aa4237a33e73..9b55259d9d53ca835a7d5e873a77e658cc6ee8d9 100644 (file)
@@ -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))]
index 6d988ae75f427f4a695ece0a315851d75d1fca8b..446d92a0e93b780ad6df029f7fec52230c89f019 100644 (file)
@@ -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))]
index 8011e9ee57f02f6b102e7fc73b393b4b3207af17..3efdce4f2a365024d54ecd636b4608aa26aae085 100644 (file)
@@ -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))]
index d541421f2fd4df1fe9963d3374134d945a0a97c1..0ee5b47d06a0eef060659d63df3d0109554e2f47 100644 (file)
@@ -1,5 +1,4 @@
 use crate::newtypes::LocalUserId;
-
 #[cfg(feature = "full")]
 use crate::schema::email_verification;
 
index 5ca5927fed2b8348ac18d15a213ef1a376045242..309e24e36dccda316b5febe36da46c3626824a67 100644 (file)
@@ -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))]
index 70f7a085ce206c561f7d786692bd1e22ae5dfdc7..2ee5ec0f02a9a58c98113fcad80f46634eaa956e 100644 (file)
@@ -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))]
index 0b86f9c607fc88efe02e2072d800d4a010b43a1f..d581300555eca07ad8ee5bf7facc22bbb1c84ee2 100644 (file)
@@ -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))]
index 3c52eb47bf7eea958212b61573bdb4222d1f8ddd..19dcf48717b662ed6411fd105fccbe8ddc270a66 100644 (file)
@@ -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))]
index 443923a4479f4de605b2453a57d8fea59cdac13e..79cd3852f00f948b77382eb2a972d44113628255 100644 (file)
@@ -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))]
index bd8901370cbe6e8935e2de0ae159fd266f96d3c7..f37f3e2da8ea87b810744d8ede344f2dfcc4f75e 100644 (file)
@@ -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))]
index 04fb4b87b64e399a0cb15a1950dd38537f90c299..37a559bc6da011d66c0d06098e6a70dd653a30d5 100644 (file)
@@ -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))]
index d234ed9902af87554f575e4c976c93ea380031e3..000e34868de12d0a089e5a08eb8af9c6d92d6e51 100644 (file)
@@ -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))]
index 159b0b7e66fd04518dcda86e012ce2853258a363..6c28c649abc42e93823d838a5da3fa91fd3ea433 100644 (file)
@@ -1,5 +1,4 @@
 use crate::newtypes::LocalUserId;
-
 #[cfg(feature = "full")]
 use crate::schema::password_reset_request;
 
index 0d2706c51aa0e73a7b5517d04474ac8aceb14480..9a5a9f7c4361b45a07bf4901f321107061d66081 100644 (file)
@@ -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))]
index e5a365b51307a1b24b9f873b3b985536bb410630..f9bd6e5652aeda91b019c4ccb1ae48ab516e9586 100644 (file)
@@ -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))]
index b4a2ce59c090e72846f1c5977e67c6de414e05c4..45892d3ab282364cfb6cca4d58d2387a85fbf80d 100644 (file)
@@ -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))]
index 9af6a3f296f5b64a8bf036efb8cc7ac50afa33a0..df3116ef3907c599eca986521c7ce0a31556bca7 100644 (file)
@@ -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))]
index abee0f32f19b2c4e1277419ea48ea5635601e41d..a9f3351bf286ed5bf6129fa599d90bc48251d4d9 100644 (file)
@@ -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))]
index f6e969f37df4c18e4a76c3b63d8a992ab05fb390..da446ffadf56167eb476c5938e12cefe97431270 100644 (file)
@@ -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))]
index 8cf3b0f00ccf9e397a71c76f708b6f84e8f579b5..f35b259f3c391eb4ecff871ca25fe53a0dc179f1 100644 (file)
@@ -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))]
index 40f00bdfabff9b003db896033d4c191a80a5a27c..1e26664d84183213c82f43919edc7697b6947424 100644 (file)
@@ -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))]
index 8c4a5b1ca2c75001eff3183ac7192870628f426e..21a0cd31afac7a1b0ae4678eb8ececd320ccedbd 100644 (file)
@@ -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))]
index e7bfdb59d35dcab1104240c94ad7885ab2815f49..40e3218249786e1dcf3b212e91dab3d9ba217cd3 100644 (file)
@@ -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() {