From 089d812dc8ccb8bf87913f47d7dd080675799742 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 18 Dec 2020 17:17:21 +0100 Subject: [PATCH 1/6] Split lemmy_db into separate workspaces --- Cargo.lock | 9 +++ Cargo.toml | 2 + lemmy_db/Cargo.toml | 1 + lemmy_db/src/aggregates/comment_aggregates.rs | 2 +- .../src/aggregates/community_aggregates.rs | 2 +- lemmy_db/src/aggregates/post_aggregates.rs | 2 +- lemmy_db/src/aggregates/site_aggregates.rs | 2 +- lemmy_db/src/aggregates/user_aggregates.rs | 2 +- lemmy_db/src/lib.rs | 1 - lemmy_db/src/source/activity.rs | 13 +-- lemmy_db/src/source/category.rs | 6 +- lemmy_db/src/source/comment.rs | 44 +++++----- lemmy_db/src/source/comment_report.rs | 10 +-- lemmy_db/src/source/community.rs | 54 +++++++------ lemmy_db/src/source/moderator.rs | 80 +++++++++---------- lemmy_db/src/source/password_reset_request.rs | 7 +- lemmy_db/src/source/post.rs | 53 ++++++------ lemmy_db/src/source/post_report.rs | 10 +-- lemmy_db/src/source/private_message.rs | 23 +++--- lemmy_db/src/source/site.rs | 11 +-- lemmy_db/src/source/user.rs | 20 +++-- lemmy_db/src/source/user_mention.rs | 13 +-- lemmy_db/src/views/comment_report_view.rs | 10 ++- lemmy_db/src/views/comment_view.rs | 26 +++--- .../community/community_follower_view.rs | 2 +- .../community/community_moderator_view.rs | 2 +- .../community/community_user_ban_view.rs | 2 +- .../src/views/community/community_view.rs | 8 +- .../views/moderator/mod_add_community_view.rs | 2 +- lemmy_db/src/views/moderator/mod_add_view.rs | 2 +- .../moderator/mod_ban_from_community_view.rs | 2 +- lemmy_db/src/views/moderator/mod_ban_view.rs | 2 +- .../src/views/moderator/mod_lock_post_view.rs | 2 +- .../moderator/mod_remove_comment_view.rs | 2 +- .../moderator/mod_remove_community_view.rs | 2 +- .../views/moderator/mod_remove_post_view.rs | 2 +- .../views/moderator/mod_sticky_post_view.rs | 2 +- lemmy_db/src/views/post_report_view.rs | 2 +- lemmy_db/src/views/post_view.rs | 22 ++--- lemmy_db/src/views/private_message_view.rs | 2 +- lemmy_db/src/views/site_view.rs | 2 +- lemmy_db/src/views/user_mention_view.rs | 26 +++--- lemmy_db/src/views/user_view.rs | 2 +- lemmy_db_schema/Cargo.toml | 7 ++ lemmy_db_schema/src/lib.rs | 4 + {lemmy_db => lemmy_db_schema}/src/schema.rs | 0 src/code_migrations.rs | 12 +-- 47 files changed, 269 insertions(+), 245 deletions(-) create mode 100644 lemmy_db_schema/Cargo.toml create mode 100644 lemmy_db_schema/src/lib.rs rename {lemmy_db => lemmy_db_schema}/src/schema.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 23622c17a..850a19e5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1789,6 +1789,7 @@ dependencies = [ "chrono", "diesel", "lazy_static", + "lemmy_db_schema", "lemmy_utils", "log", "regex", @@ -1800,6 +1801,13 @@ dependencies = [ "url", ] +[[package]] +name = "lemmy_db_schema" +version = "0.1.0" +dependencies = [ + "diesel", +] + [[package]] name = "lemmy_rate_limit" version = "0.1.0" @@ -1835,6 +1843,7 @@ dependencies = [ "lemmy_api", "lemmy_apub", "lemmy_db", + "lemmy_db_schema", "lemmy_rate_limit", "lemmy_structs", "lemmy_utils", diff --git a/Cargo.toml b/Cargo.toml index f5b03adc5..7f2b1a8be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ members = [ "lemmy_apub", "lemmy_utils", "lemmy_db", + "lemmy_db_schema", "lemmy_structs", "lemmy_rate_limit", "lemmy_websocket", @@ -21,6 +22,7 @@ members = [ lemmy_api = { path = "./lemmy_api" } lemmy_apub = { path = "./lemmy_apub" } lemmy_utils = { path = "./lemmy_utils" } +lemmy_db_schema = { path = "./lemmy_db_schema" } lemmy_db = { path = "./lemmy_db" } lemmy_structs = { path = "./lemmy_structs" } lemmy_rate_limit = { path = "./lemmy_rate_limit" } diff --git a/lemmy_db/Cargo.toml b/lemmy_db/Cargo.toml index d7c0fe3b0..849dba8e7 100644 --- a/lemmy_db/Cargo.toml +++ b/lemmy_db/Cargo.toml @@ -9,6 +9,7 @@ path = "src/lib.rs" [dependencies] lemmy_utils = { path = "../lemmy_utils" } +lemmy_db_schema = { path = "../lemmy_db_schema" } diesel = { version = "1.4.5", features = ["postgres","chrono","r2d2","serde_json"] } chrono = { version = "0.4.19", features = ["serde"] } serde = { version = "1.0.118", features = ["derive"] } diff --git a/lemmy_db/src/aggregates/comment_aggregates.rs b/lemmy_db/src/aggregates/comment_aggregates.rs index 7ce52ed42..2bfd39393 100644 --- a/lemmy_db/src/aggregates/comment_aggregates.rs +++ b/lemmy_db/src/aggregates/comment_aggregates.rs @@ -1,5 +1,5 @@ -use crate::schema::comment_aggregates; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::comment_aggregates; use serde::Serialize; #[derive(Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Clone)] diff --git a/lemmy_db/src/aggregates/community_aggregates.rs b/lemmy_db/src/aggregates/community_aggregates.rs index 8c977bf0c..47c40f7bc 100644 --- a/lemmy_db/src/aggregates/community_aggregates.rs +++ b/lemmy_db/src/aggregates/community_aggregates.rs @@ -1,5 +1,5 @@ -use crate::schema::community_aggregates; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::community_aggregates; use serde::Serialize; #[derive(Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Clone)] diff --git a/lemmy_db/src/aggregates/post_aggregates.rs b/lemmy_db/src/aggregates/post_aggregates.rs index dff16f9b1..6cb3a7406 100644 --- a/lemmy_db/src/aggregates/post_aggregates.rs +++ b/lemmy_db/src/aggregates/post_aggregates.rs @@ -1,5 +1,5 @@ -use crate::schema::post_aggregates; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::post_aggregates; use serde::Serialize; #[derive(Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Clone)] diff --git a/lemmy_db/src/aggregates/site_aggregates.rs b/lemmy_db/src/aggregates/site_aggregates.rs index 6856bfc9e..a3bd199c1 100644 --- a/lemmy_db/src/aggregates/site_aggregates.rs +++ b/lemmy_db/src/aggregates/site_aggregates.rs @@ -1,5 +1,5 @@ -use crate::schema::site_aggregates; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::site_aggregates; use serde::Serialize; #[derive(Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)] diff --git a/lemmy_db/src/aggregates/user_aggregates.rs b/lemmy_db/src/aggregates/user_aggregates.rs index 104bf6f7d..f6eab4679 100644 --- a/lemmy_db/src/aggregates/user_aggregates.rs +++ b/lemmy_db/src/aggregates/user_aggregates.rs @@ -1,5 +1,5 @@ -use crate::schema::user_aggregates; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::user_aggregates; use serde::Serialize; #[derive(Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Clone)] diff --git a/lemmy_db/src/lib.rs b/lemmy_db/src/lib.rs index 387e38a28..52180fb72 100644 --- a/lemmy_db/src/lib.rs +++ b/lemmy_db/src/lib.rs @@ -12,7 +12,6 @@ use serde::{Deserialize, Serialize}; use std::{env, env::VarError}; pub mod aggregates; -pub mod schema; pub mod source; pub mod views; diff --git a/lemmy_db/src/source/activity.rs b/lemmy_db/src/source/activity.rs index b4b54c6ed..38a353a4a 100644 --- a/lemmy_db/src/source/activity.rs +++ b/lemmy_db/src/source/activity.rs @@ -1,5 +1,6 @@ -use crate::{schema::activity, Crud}; +use crate::Crud; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::activity; use log::debug; use serde::Serialize; use serde_json::Value; @@ -32,12 +33,12 @@ pub struct ActivityForm { impl Crud for Activity { fn read(conn: &PgConnection, activity_id: i32) -> Result { - use crate::schema::activity::dsl::*; + use lemmy_db_schema::schema::activity::dsl::*; activity.find(activity_id).first::(conn) } fn create(conn: &PgConnection, new_activity: &ActivityForm) -> Result { - use crate::schema::activity::dsl::*; + use lemmy_db_schema::schema::activity::dsl::*; insert_into(activity) .values(new_activity) .get_result::(conn) @@ -48,13 +49,13 @@ impl Crud for Activity { activity_id: i32, new_activity: &ActivityForm, ) -> Result { - use crate::schema::activity::dsl::*; + use lemmy_db_schema::schema::activity::dsl::*; diesel::update(activity.find(activity_id)) .set(new_activity) .get_result::(conn) } fn delete(conn: &PgConnection, activity_id: i32) -> Result { - use crate::schema::activity::dsl::*; + use lemmy_db_schema::schema::activity::dsl::*; diesel::delete(activity.find(activity_id)).execute(conn) } } @@ -89,7 +90,7 @@ impl Activity { } pub fn read_from_apub_id(conn: &PgConnection, object_id: &str) -> Result { - use crate::schema::activity::dsl::*; + use lemmy_db_schema::schema::activity::dsl::*; activity.filter(ap_id.eq(object_id)).first::(conn) } } diff --git a/lemmy_db/src/source/category.rs b/lemmy_db/src/source/category.rs index 95b65dc82..9ace8f512 100644 --- a/lemmy_db/src/source/category.rs +++ b/lemmy_db/src/source/category.rs @@ -1,8 +1,6 @@ -use crate::{ - schema::{category, category::dsl::*}, - Crud, -}; +use crate::Crud; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::{category, category::dsl::*}; use serde::Serialize; #[derive(Queryable, Identifiable, PartialEq, Debug, Serialize, Clone)] diff --git a/lemmy_db/src/source/comment.rs b/lemmy_db/src/source/comment.rs index 380bdb3d1..76cd9133d 100644 --- a/lemmy_db/src/source/comment.rs +++ b/lemmy_db/src/source/comment.rs @@ -1,13 +1,7 @@ use super::post::Post; -use crate::{ - naive_now, - schema::{comment, comment_alias_1, comment_like, comment_saved}, - ApubObject, - Crud, - Likeable, - Saveable, -}; +use crate::{naive_now, ApubObject, Crud, Likeable, Saveable}; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::{comment, comment_alias_1, comment_like, comment_saved}; use serde::Serialize; use url::{ParseError, Url}; @@ -78,17 +72,17 @@ impl CommentForm { impl Crud for Comment { fn read(conn: &PgConnection, comment_id: i32) -> Result { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; comment.find(comment_id).first::(conn) } fn delete(conn: &PgConnection, comment_id: i32) -> Result { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; diesel::delete(comment.find(comment_id)).execute(conn) } fn create(conn: &PgConnection, comment_form: &CommentForm) -> Result { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; insert_into(comment) .values(comment_form) .get_result::(conn) @@ -99,7 +93,7 @@ impl Crud for Comment { comment_id: i32, comment_form: &CommentForm, ) -> Result { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; diesel::update(comment.find(comment_id)) .set(comment_form) .get_result::(conn) @@ -108,12 +102,12 @@ impl Crud for Comment { impl ApubObject for Comment { fn read_from_apub_id(conn: &PgConnection, object_id: &str) -> Result { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; comment.filter(ap_id.eq(object_id)).first::(conn) } fn upsert(conn: &PgConnection, comment_form: &CommentForm) -> Result { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; insert_into(comment) .values(comment_form) .on_conflict(ap_id) @@ -129,7 +123,7 @@ impl Comment { comment_id: i32, apub_id: String, ) -> Result { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; diesel::update(comment.find(comment_id)) .set(ap_id.eq(apub_id)) @@ -140,7 +134,7 @@ impl Comment { conn: &PgConnection, for_creator_id: i32, ) -> Result, Error> { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; diesel::update(comment.filter(creator_id.eq(for_creator_id))) .set(( content.eq("*Permananently Deleted*"), @@ -155,7 +149,7 @@ impl Comment { comment_id: i32, new_deleted: bool, ) -> Result { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; diesel::update(comment.find(comment_id)) .set((deleted.eq(new_deleted), updated.eq(naive_now()))) .get_result::(conn) @@ -166,7 +160,7 @@ impl Comment { comment_id: i32, new_removed: bool, ) -> Result { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; diesel::update(comment.find(comment_id)) .set((removed.eq(new_removed), updated.eq(naive_now()))) .get_result::(conn) @@ -177,14 +171,14 @@ impl Comment { for_creator_id: i32, new_removed: bool, ) -> Result, Error> { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; diesel::update(comment.filter(creator_id.eq(for_creator_id))) .set((removed.eq(new_removed), updated.eq(naive_now()))) .get_results::(conn) } pub fn update_read(conn: &PgConnection, comment_id: i32, new_read: bool) -> Result { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; diesel::update(comment.find(comment_id)) .set(read.eq(new_read)) .get_result::(conn) @@ -195,7 +189,7 @@ impl Comment { comment_id: i32, new_content: &str, ) -> Result { - use crate::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; diesel::update(comment.find(comment_id)) .set((content.eq(new_content), updated.eq(naive_now()))) .get_result::(conn) @@ -225,7 +219,7 @@ pub struct CommentLikeForm { impl Likeable for CommentLike { fn like(conn: &PgConnection, comment_like_form: &CommentLikeForm) -> Result { - use crate::schema::comment_like::dsl::*; + use lemmy_db_schema::schema::comment_like::dsl::*; insert_into(comment_like) .values(comment_like_form) .on_conflict((comment_id, user_id)) @@ -234,7 +228,7 @@ impl Likeable for CommentLike { .get_result::(conn) } fn remove(conn: &PgConnection, user_id: i32, comment_id: i32) -> Result { - use crate::schema::comment_like::dsl; + use lemmy_db_schema::schema::comment_like::dsl; diesel::delete( dsl::comment_like .filter(dsl::comment_id.eq(comment_id)) @@ -263,7 +257,7 @@ pub struct CommentSavedForm { impl Saveable for CommentSaved { fn save(conn: &PgConnection, comment_saved_form: &CommentSavedForm) -> Result { - use crate::schema::comment_saved::dsl::*; + use lemmy_db_schema::schema::comment_saved::dsl::*; insert_into(comment_saved) .values(comment_saved_form) .on_conflict((comment_id, user_id)) @@ -272,7 +266,7 @@ impl Saveable for CommentSaved { .get_result::(conn) } fn unsave(conn: &PgConnection, comment_saved_form: &CommentSavedForm) -> Result { - use crate::schema::comment_saved::dsl::*; + use lemmy_db_schema::schema::comment_saved::dsl::*; diesel::delete( comment_saved .filter(comment_id.eq(comment_saved_form.comment_id)) diff --git a/lemmy_db/src/source/comment_report.rs b/lemmy_db/src/source/comment_report.rs index a53759916..2937e6315 100644 --- a/lemmy_db/src/source/comment_report.rs +++ b/lemmy_db/src/source/comment_report.rs @@ -1,8 +1,8 @@ +use crate::{naive_now, source::comment::Comment, Reportable}; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::comment_report; use serde::{Deserialize, Serialize}; -use crate::{naive_now, schema::comment_report, source::comment::Comment, Reportable}; - #[derive(Identifiable, Queryable, Associations, PartialEq, Serialize, Deserialize, Debug, Clone)] #[belongs_to(Comment)] #[table_name = "comment_report"] @@ -33,7 +33,7 @@ impl Reportable for CommentReport { /// * `conn` - the postgres connection /// * `comment_report_form` - the filled CommentReportForm to insert fn report(conn: &PgConnection, comment_report_form: &CommentReportForm) -> Result { - use crate::schema::comment_report::dsl::*; + use lemmy_db_schema::schema::comment_report::dsl::*; insert_into(comment_report) .values(comment_report_form) .get_result::(conn) @@ -45,7 +45,7 @@ impl Reportable for CommentReport { /// * `report_id` - the id of the report to resolve /// * `by_resolver_id` - the id of the user resolving the report fn resolve(conn: &PgConnection, report_id: i32, by_resolver_id: i32) -> Result { - use crate::schema::comment_report::dsl::*; + use lemmy_db_schema::schema::comment_report::dsl::*; update(comment_report.find(report_id)) .set(( resolved.eq(true), @@ -61,7 +61,7 @@ impl Reportable for CommentReport { /// * `report_id` - the id of the report to unresolve /// * `by_resolver_id` - the id of the user unresolving the report fn unresolve(conn: &PgConnection, report_id: i32, by_resolver_id: i32) -> Result { - use crate::schema::comment_report::dsl::*; + use lemmy_db_schema::schema::comment_report::dsl::*; update(comment_report.find(report_id)) .set(( resolved.eq(false), diff --git a/lemmy_db/src/source/community.rs b/lemmy_db/src/source/community.rs index 0ad90da28..05bc3c5c7 100644 --- a/lemmy_db/src/source/community.rs +++ b/lemmy_db/src/source/community.rs @@ -1,6 +1,5 @@ use crate::{ naive_now, - schema::{community, community_follower, community_moderator, community_user_ban}, views::{community::community_moderator_view::CommunityModeratorView, user_view::UserViewSafe}, ApubObject, Bannable, @@ -9,6 +8,12 @@ use crate::{ Joinable, }; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::{ + community, + community_follower, + community_moderator, + community_user_ban, +}; use serde::Serialize; #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] @@ -56,7 +61,8 @@ pub struct CommunitySafe { } mod safe_type { - use crate::{schema::community::columns::*, source::community::Community, ToSafe}; + use crate::{source::community::Community, ToSafe}; + use lemmy_db_schema::schema::community::columns::*; type Columns = ( id, name, @@ -123,17 +129,17 @@ pub struct CommunityForm { impl Crud for Community { fn read(conn: &PgConnection, community_id: i32) -> Result { - use crate::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; community.find(community_id).first::(conn) } fn delete(conn: &PgConnection, community_id: i32) -> Result { - use crate::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; diesel::delete(community.find(community_id)).execute(conn) } fn create(conn: &PgConnection, new_community: &CommunityForm) -> Result { - use crate::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; insert_into(community) .values(new_community) .get_result::(conn) @@ -144,7 +150,7 @@ impl Crud for Community { community_id: i32, new_community: &CommunityForm, ) -> Result { - use crate::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; diesel::update(community.find(community_id)) .set(new_community) .get_result::(conn) @@ -153,14 +159,14 @@ impl Crud for Community { impl ApubObject for Community { fn read_from_apub_id(conn: &PgConnection, for_actor_id: &str) -> Result { - use crate::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; community .filter(actor_id.eq(for_actor_id)) .first::(conn) } fn upsert(conn: &PgConnection, community_form: &CommunityForm) -> Result { - use crate::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; insert_into(community) .values(community_form) .on_conflict(actor_id) @@ -172,7 +178,7 @@ impl ApubObject for Community { impl Community { pub fn read_from_name(conn: &PgConnection, community_name: &str) -> Result { - use crate::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; community .filter(local.eq(true)) .filter(name.eq(community_name)) @@ -184,7 +190,7 @@ impl Community { community_id: i32, new_deleted: bool, ) -> Result { - use crate::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; diesel::update(community.find(community_id)) .set((deleted.eq(new_deleted), updated.eq(naive_now()))) .get_result::(conn) @@ -195,7 +201,7 @@ impl Community { community_id: i32, new_removed: bool, ) -> Result { - use crate::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; diesel::update(community.find(community_id)) .set((removed.eq(new_removed), updated.eq(naive_now()))) .get_result::(conn) @@ -206,7 +212,7 @@ impl Community { for_creator_id: i32, new_removed: bool, ) -> Result, Error> { - use crate::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; diesel::update(community.filter(creator_id.eq(for_creator_id))) .set((removed.eq(new_removed), updated.eq(naive_now()))) .get_results::(conn) @@ -217,7 +223,7 @@ impl Community { community_id: i32, new_creator_id: i32, ) -> Result { - use crate::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; diesel::update(community.find(community_id)) .set((creator_id.eq(new_creator_id), updated.eq(naive_now()))) .get_result::(conn) @@ -235,7 +241,7 @@ impl Community { } pub fn distinct_federated_communities(conn: &PgConnection) -> Result, Error> { - use crate::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; community.select(actor_id).distinct().load::(conn) } @@ -268,7 +274,7 @@ impl Joinable for CommunityModerator { conn: &PgConnection, community_user_form: &CommunityModeratorForm, ) -> Result { - use crate::schema::community_moderator::dsl::*; + use lemmy_db_schema::schema::community_moderator::dsl::*; insert_into(community_moderator) .values(community_user_form) .get_result::(conn) @@ -278,7 +284,7 @@ impl Joinable for CommunityModerator { conn: &PgConnection, community_user_form: &CommunityModeratorForm, ) -> Result { - use crate::schema::community_moderator::dsl::*; + use lemmy_db_schema::schema::community_moderator::dsl::*; diesel::delete( community_moderator .filter(community_id.eq(community_user_form.community_id)) @@ -290,7 +296,7 @@ impl Joinable for CommunityModerator { impl CommunityModerator { pub fn delete_for_community(conn: &PgConnection, for_community_id: i32) -> Result { - use crate::schema::community_moderator::dsl::*; + use lemmy_db_schema::schema::community_moderator::dsl::*; diesel::delete(community_moderator.filter(community_id.eq(for_community_id))).execute(conn) } @@ -298,7 +304,7 @@ impl CommunityModerator { conn: &PgConnection, for_user_id: i32, ) -> Result, Error> { - use crate::schema::community_moderator::dsl::*; + use lemmy_db_schema::schema::community_moderator::dsl::*; community_moderator .filter(user_id.eq(for_user_id)) .select(community_id) @@ -328,7 +334,7 @@ impl Bannable for CommunityUserBan { conn: &PgConnection, community_user_ban_form: &CommunityUserBanForm, ) -> Result { - use crate::schema::community_user_ban::dsl::*; + use lemmy_db_schema::schema::community_user_ban::dsl::*; insert_into(community_user_ban) .values(community_user_ban_form) .get_result::(conn) @@ -338,7 +344,7 @@ impl Bannable for CommunityUserBan { conn: &PgConnection, community_user_ban_form: &CommunityUserBanForm, ) -> Result { - use crate::schema::community_user_ban::dsl::*; + use lemmy_db_schema::schema::community_user_ban::dsl::*; diesel::delete( community_user_ban .filter(community_id.eq(community_user_ban_form.community_id)) @@ -372,7 +378,7 @@ impl Followable for CommunityFollower { conn: &PgConnection, community_follower_form: &CommunityFollowerForm, ) -> Result { - use crate::schema::community_follower::dsl::*; + use lemmy_db_schema::schema::community_follower::dsl::*; insert_into(community_follower) .values(community_follower_form) .on_conflict((community_id, user_id)) @@ -384,7 +390,7 @@ impl Followable for CommunityFollower { where Self: Sized, { - use crate::schema::community_follower::dsl::*; + use lemmy_db_schema::schema::community_follower::dsl::*; diesel::update( community_follower .filter(community_id.eq(community_id_)) @@ -397,7 +403,7 @@ impl Followable for CommunityFollower { conn: &PgConnection, community_follower_form: &CommunityFollowerForm, ) -> Result { - use crate::schema::community_follower::dsl::*; + use lemmy_db_schema::schema::community_follower::dsl::*; diesel::delete( community_follower .filter(community_id.eq(&community_follower_form.community_id)) @@ -408,7 +414,7 @@ impl Followable for CommunityFollower { // TODO: this function name only makes sense if you call it with a remote community. for a local // community, it will also return true if only remote followers exist fn has_local_followers(conn: &PgConnection, community_id_: i32) -> Result { - use crate::schema::community_follower::dsl::*; + use lemmy_db_schema::schema::community_follower::dsl::*; diesel::select(exists( community_follower.filter(community_id.eq(community_id_)), )) diff --git a/lemmy_db/src/source/moderator.rs b/lemmy_db/src/source/moderator.rs index 766c17fc5..0766f49cd 100644 --- a/lemmy_db/src/source/moderator.rs +++ b/lemmy_db/src/source/moderator.rs @@ -1,18 +1,16 @@ -use crate::{ - schema::{ - mod_add, - mod_add_community, - mod_ban, - mod_ban_from_community, - mod_lock_post, - mod_remove_comment, - mod_remove_community, - mod_remove_post, - mod_sticky_post, - }, - Crud, -}; +use crate::Crud; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::{ + mod_add, + mod_add_community, + mod_ban, + mod_ban_from_community, + mod_lock_post, + mod_remove_comment, + mod_remove_community, + mod_remove_post, + mod_sticky_post, +}; use serde::Serialize; #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] @@ -37,19 +35,19 @@ pub struct ModRemovePostForm { impl Crud for ModRemovePost { fn read(conn: &PgConnection, from_id: i32) -> Result { - use crate::schema::mod_remove_post::dsl::*; + use lemmy_db_schema::schema::mod_remove_post::dsl::*; mod_remove_post.find(from_id).first::(conn) } fn create(conn: &PgConnection, form: &ModRemovePostForm) -> Result { - use crate::schema::mod_remove_post::dsl::*; + use lemmy_db_schema::schema::mod_remove_post::dsl::*; insert_into(mod_remove_post) .values(form) .get_result::(conn) } fn update(conn: &PgConnection, from_id: i32, form: &ModRemovePostForm) -> Result { - use crate::schema::mod_remove_post::dsl::*; + use lemmy_db_schema::schema::mod_remove_post::dsl::*; diesel::update(mod_remove_post.find(from_id)) .set(form) .get_result::(conn) @@ -76,19 +74,19 @@ pub struct ModLockPostForm { impl Crud for ModLockPost { fn read(conn: &PgConnection, from_id: i32) -> Result { - use crate::schema::mod_lock_post::dsl::*; + use lemmy_db_schema::schema::mod_lock_post::dsl::*; mod_lock_post.find(from_id).first::(conn) } fn create(conn: &PgConnection, form: &ModLockPostForm) -> Result { - use crate::schema::mod_lock_post::dsl::*; + use lemmy_db_schema::schema::mod_lock_post::dsl::*; insert_into(mod_lock_post) .values(form) .get_result::(conn) } fn update(conn: &PgConnection, from_id: i32, form: &ModLockPostForm) -> Result { - use crate::schema::mod_lock_post::dsl::*; + use lemmy_db_schema::schema::mod_lock_post::dsl::*; diesel::update(mod_lock_post.find(from_id)) .set(form) .get_result::(conn) @@ -115,19 +113,19 @@ pub struct ModStickyPostForm { impl Crud for ModStickyPost { fn read(conn: &PgConnection, from_id: i32) -> Result { - use crate::schema::mod_sticky_post::dsl::*; + use lemmy_db_schema::schema::mod_sticky_post::dsl::*; mod_sticky_post.find(from_id).first::(conn) } fn create(conn: &PgConnection, form: &ModStickyPostForm) -> Result { - use crate::schema::mod_sticky_post::dsl::*; + use lemmy_db_schema::schema::mod_sticky_post::dsl::*; insert_into(mod_sticky_post) .values(form) .get_result::(conn) } fn update(conn: &PgConnection, from_id: i32, form: &ModStickyPostForm) -> Result { - use crate::schema::mod_sticky_post::dsl::*; + use lemmy_db_schema::schema::mod_sticky_post::dsl::*; diesel::update(mod_sticky_post.find(from_id)) .set(form) .get_result::(conn) @@ -156,19 +154,19 @@ pub struct ModRemoveCommentForm { impl Crud for ModRemoveComment { fn read(conn: &PgConnection, from_id: i32) -> Result { - use crate::schema::mod_remove_comment::dsl::*; + use lemmy_db_schema::schema::mod_remove_comment::dsl::*; mod_remove_comment.find(from_id).first::(conn) } fn create(conn: &PgConnection, form: &ModRemoveCommentForm) -> Result { - use crate::schema::mod_remove_comment::dsl::*; + use lemmy_db_schema::schema::mod_remove_comment::dsl::*; insert_into(mod_remove_comment) .values(form) .get_result::(conn) } fn update(conn: &PgConnection, from_id: i32, form: &ModRemoveCommentForm) -> Result { - use crate::schema::mod_remove_comment::dsl::*; + use lemmy_db_schema::schema::mod_remove_comment::dsl::*; diesel::update(mod_remove_comment.find(from_id)) .set(form) .get_result::(conn) @@ -199,12 +197,12 @@ pub struct ModRemoveCommunityForm { impl Crud for ModRemoveCommunity { fn read(conn: &PgConnection, from_id: i32) -> Result { - use crate::schema::mod_remove_community::dsl::*; + use lemmy_db_schema::schema::mod_remove_community::dsl::*; mod_remove_community.find(from_id).first::(conn) } fn create(conn: &PgConnection, form: &ModRemoveCommunityForm) -> Result { - use crate::schema::mod_remove_community::dsl::*; + use lemmy_db_schema::schema::mod_remove_community::dsl::*; insert_into(mod_remove_community) .values(form) .get_result::(conn) @@ -215,7 +213,7 @@ impl Crud for ModRemoveCommunity { from_id: i32, form: &ModRemoveCommunityForm, ) -> Result { - use crate::schema::mod_remove_community::dsl::*; + use lemmy_db_schema::schema::mod_remove_community::dsl::*; diesel::update(mod_remove_community.find(from_id)) .set(form) .get_result::(conn) @@ -248,12 +246,12 @@ pub struct ModBanFromCommunityForm { impl Crud for ModBanFromCommunity { fn read(conn: &PgConnection, from_id: i32) -> Result { - use crate::schema::mod_ban_from_community::dsl::*; + use lemmy_db_schema::schema::mod_ban_from_community::dsl::*; mod_ban_from_community.find(from_id).first::(conn) } fn create(conn: &PgConnection, form: &ModBanFromCommunityForm) -> Result { - use crate::schema::mod_ban_from_community::dsl::*; + use lemmy_db_schema::schema::mod_ban_from_community::dsl::*; insert_into(mod_ban_from_community) .values(form) .get_result::(conn) @@ -264,7 +262,7 @@ impl Crud for ModBanFromCommunity { from_id: i32, form: &ModBanFromCommunityForm, ) -> Result { - use crate::schema::mod_ban_from_community::dsl::*; + use lemmy_db_schema::schema::mod_ban_from_community::dsl::*; diesel::update(mod_ban_from_community.find(from_id)) .set(form) .get_result::(conn) @@ -295,17 +293,17 @@ pub struct ModBanForm { impl Crud for ModBan { fn read(conn: &PgConnection, from_id: i32) -> Result { - use crate::schema::mod_ban::dsl::*; + use lemmy_db_schema::schema::mod_ban::dsl::*; mod_ban.find(from_id).first::(conn) } fn create(conn: &PgConnection, form: &ModBanForm) -> Result { - use crate::schema::mod_ban::dsl::*; + use lemmy_db_schema::schema::mod_ban::dsl::*; insert_into(mod_ban).values(form).get_result::(conn) } fn update(conn: &PgConnection, from_id: i32, form: &ModBanForm) -> Result { - use crate::schema::mod_ban::dsl::*; + use lemmy_db_schema::schema::mod_ban::dsl::*; diesel::update(mod_ban.find(from_id)) .set(form) .get_result::(conn) @@ -334,19 +332,19 @@ pub struct ModAddCommunityForm { impl Crud for ModAddCommunity { fn read(conn: &PgConnection, from_id: i32) -> Result { - use crate::schema::mod_add_community::dsl::*; + use lemmy_db_schema::schema::mod_add_community::dsl::*; mod_add_community.find(from_id).first::(conn) } fn create(conn: &PgConnection, form: &ModAddCommunityForm) -> Result { - use crate::schema::mod_add_community::dsl::*; + use lemmy_db_schema::schema::mod_add_community::dsl::*; insert_into(mod_add_community) .values(form) .get_result::(conn) } fn update(conn: &PgConnection, from_id: i32, form: &ModAddCommunityForm) -> Result { - use crate::schema::mod_add_community::dsl::*; + use lemmy_db_schema::schema::mod_add_community::dsl::*; diesel::update(mod_add_community.find(from_id)) .set(form) .get_result::(conn) @@ -373,17 +371,17 @@ pub struct ModAddForm { impl Crud for ModAdd { fn read(conn: &PgConnection, from_id: i32) -> Result { - use crate::schema::mod_add::dsl::*; + use lemmy_db_schema::schema::mod_add::dsl::*; mod_add.find(from_id).first::(conn) } fn create(conn: &PgConnection, form: &ModAddForm) -> Result { - use crate::schema::mod_add::dsl::*; + use lemmy_db_schema::schema::mod_add::dsl::*; insert_into(mod_add).values(form).get_result::(conn) } fn update(conn: &PgConnection, from_id: i32, form: &ModAddForm) -> Result { - use crate::schema::mod_add::dsl::*; + use lemmy_db_schema::schema::mod_add::dsl::*; diesel::update(mod_add.find(from_id)) .set(form) .get_result::(conn) diff --git a/lemmy_db/src/source/password_reset_request.rs b/lemmy_db/src/source/password_reset_request.rs index 0cf0169f0..3c9969e41 100644 --- a/lemmy_db/src/source/password_reset_request.rs +++ b/lemmy_db/src/source/password_reset_request.rs @@ -1,8 +1,6 @@ -use crate::{ - schema::{password_reset_request, password_reset_request::dsl::*}, - Crud, -}; +use crate::Crud; use diesel::{dsl::*, result::Error, PgConnection, *}; +use lemmy_db_schema::schema::{password_reset_request, password_reset_request::dsl::*}; use sha2::{Digest, Sha256}; #[derive(Queryable, Identifiable, PartialEq, Debug)] @@ -23,7 +21,6 @@ pub struct PasswordResetRequestForm { impl Crud for PasswordResetRequest { fn read(conn: &PgConnection, password_reset_request_id: i32) -> Result { - use crate::schema::password_reset_request::dsl::*; password_reset_request .find(password_reset_request_id) .first::(conn) diff --git a/lemmy_db/src/source/post.rs b/lemmy_db/src/source/post.rs index 098ce8835..181157a21 100644 --- a/lemmy_db/src/source/post.rs +++ b/lemmy_db/src/source/post.rs @@ -1,13 +1,6 @@ -use crate::{ - naive_now, - schema::{post, post_like, post_read, post_saved}, - ApubObject, - Crud, - Likeable, - Readable, - Saveable, -}; +use crate::{naive_now, ApubObject, Crud, Likeable, Readable, Saveable}; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::{post, post_like, post_read, post_saved}; use serde::Serialize; use url::{ParseError, Url}; @@ -66,22 +59,22 @@ impl PostForm { impl Crud for Post { fn read(conn: &PgConnection, post_id: i32) -> Result { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; post.find(post_id).first::(conn) } fn delete(conn: &PgConnection, post_id: i32) -> Result { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; diesel::delete(post.find(post_id)).execute(conn) } fn create(conn: &PgConnection, new_post: &PostForm) -> Result { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; insert_into(post).values(new_post).get_result::(conn) } fn update(conn: &PgConnection, post_id: i32, new_post: &PostForm) -> Result { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; diesel::update(post.find(post_id)) .set(new_post) .get_result::(conn) @@ -90,12 +83,12 @@ impl Crud for Post { impl ApubObject for Post { fn read_from_apub_id(conn: &PgConnection, object_id: &str) -> Result { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; post.filter(ap_id.eq(object_id)).first::(conn) } fn upsert(conn: &PgConnection, post_form: &PostForm) -> Result { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; insert_into(post) .values(post_form) .on_conflict(ap_id) @@ -107,7 +100,7 @@ impl ApubObject for Post { impl Post { pub fn read(conn: &PgConnection, post_id: i32) -> Result { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; post.filter(id.eq(post_id)).first::(conn) } @@ -115,7 +108,7 @@ impl Post { conn: &PgConnection, the_community_id: i32, ) -> Result, Error> { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; post .filter(community_id.eq(the_community_id)) .then_order_by(published.desc()) @@ -125,7 +118,7 @@ impl Post { } pub fn update_ap_id(conn: &PgConnection, post_id: i32, apub_id: String) -> Result { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; diesel::update(post.find(post_id)) .set(ap_id.eq(apub_id)) @@ -136,7 +129,7 @@ impl Post { conn: &PgConnection, for_creator_id: i32, ) -> Result, Error> { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; let perma_deleted = "*Permananently Deleted*"; let perma_deleted_url = "https://deleted.com"; @@ -157,7 +150,7 @@ impl Post { post_id: i32, new_deleted: bool, ) -> Result { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; diesel::update(post.find(post_id)) .set((deleted.eq(new_deleted), updated.eq(naive_now()))) .get_result::(conn) @@ -168,7 +161,7 @@ impl Post { post_id: i32, new_removed: bool, ) -> Result { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; diesel::update(post.find(post_id)) .set((removed.eq(new_removed), updated.eq(naive_now()))) .get_result::(conn) @@ -180,7 +173,7 @@ impl Post { for_community_id: Option, new_removed: bool, ) -> Result, Error> { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; let mut update = diesel::update(post).into_boxed(); update = update.filter(creator_id.eq(for_creator_id)); @@ -195,7 +188,7 @@ impl Post { } pub fn update_locked(conn: &PgConnection, post_id: i32, new_locked: bool) -> Result { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; diesel::update(post.find(post_id)) .set(locked.eq(new_locked)) .get_result::(conn) @@ -206,7 +199,7 @@ impl Post { post_id: i32, new_stickied: bool, ) -> Result { - use crate::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; diesel::update(post.find(post_id)) .set(stickied.eq(new_stickied)) .get_result::(conn) @@ -238,7 +231,7 @@ pub struct PostLikeForm { impl Likeable for PostLike { fn like(conn: &PgConnection, post_like_form: &PostLikeForm) -> Result { - use crate::schema::post_like::dsl::*; + use lemmy_db_schema::schema::post_like::dsl::*; insert_into(post_like) .values(post_like_form) .on_conflict((post_id, user_id)) @@ -247,7 +240,7 @@ impl Likeable for PostLike { .get_result::(conn) } fn remove(conn: &PgConnection, user_id: i32, post_id: i32) -> Result { - use crate::schema::post_like::dsl; + use lemmy_db_schema::schema::post_like::dsl; diesel::delete( dsl::post_like .filter(dsl::post_id.eq(post_id)) @@ -276,7 +269,7 @@ pub struct PostSavedForm { impl Saveable for PostSaved { fn save(conn: &PgConnection, post_saved_form: &PostSavedForm) -> Result { - use crate::schema::post_saved::dsl::*; + use lemmy_db_schema::schema::post_saved::dsl::*; insert_into(post_saved) .values(post_saved_form) .on_conflict((post_id, user_id)) @@ -285,7 +278,7 @@ impl Saveable for PostSaved { .get_result::(conn) } fn unsave(conn: &PgConnection, post_saved_form: &PostSavedForm) -> Result { - use crate::schema::post_saved::dsl::*; + use lemmy_db_schema::schema::post_saved::dsl::*; diesel::delete( post_saved .filter(post_id.eq(post_saved_form.post_id)) @@ -318,14 +311,14 @@ pub struct PostReadForm { impl Readable for PostRead { fn mark_as_read(conn: &PgConnection, post_read_form: &PostReadForm) -> Result { - use crate::schema::post_read::dsl::*; + use lemmy_db_schema::schema::post_read::dsl::*; insert_into(post_read) .values(post_read_form) .get_result::(conn) } fn mark_as_unread(conn: &PgConnection, post_read_form: &PostReadForm) -> Result { - use crate::schema::post_read::dsl::*; + use lemmy_db_schema::schema::post_read::dsl::*; diesel::delete( post_read .filter(post_id.eq(post_read_form.post_id)) diff --git a/lemmy_db/src/source/post_report.rs b/lemmy_db/src/source/post_report.rs index 6de82a257..af45aa3d0 100644 --- a/lemmy_db/src/source/post_report.rs +++ b/lemmy_db/src/source/post_report.rs @@ -1,8 +1,8 @@ +use crate::{naive_now, source::post::Post, Reportable}; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::post_report; use serde::{Deserialize, Serialize}; -use crate::{naive_now, schema::post_report, source::post::Post, Reportable}; - #[derive(Identifiable, Queryable, Associations, PartialEq, Serialize, Deserialize, Debug, Clone)] #[belongs_to(Post)] #[table_name = "post_report"] @@ -37,7 +37,7 @@ impl Reportable for PostReport { /// * `conn` - the postgres connection /// * `post_report_form` - the filled CommentReportForm to insert fn report(conn: &PgConnection, post_report_form: &PostReportForm) -> Result { - use crate::schema::post_report::dsl::*; + use lemmy_db_schema::schema::post_report::dsl::*; insert_into(post_report) .values(post_report_form) .get_result::(conn) @@ -49,7 +49,7 @@ impl Reportable for PostReport { /// * `report_id` - the id of the report to resolve /// * `by_resolver_id` - the id of the user resolving the report fn resolve(conn: &PgConnection, report_id: i32, by_resolver_id: i32) -> Result { - use crate::schema::post_report::dsl::*; + use lemmy_db_schema::schema::post_report::dsl::*; update(post_report.find(report_id)) .set(( resolved.eq(true), @@ -65,7 +65,7 @@ impl Reportable for PostReport { /// * `report_id` - the id of the report to unresolve /// * `by_resolver_id` - the id of the user unresolving the report fn unresolve(conn: &PgConnection, report_id: i32, by_resolver_id: i32) -> Result { - use crate::schema::post_report::dsl::*; + use lemmy_db_schema::schema::post_report::dsl::*; update(post_report.find(report_id)) .set(( resolved.eq(false), diff --git a/lemmy_db/src/source/private_message.rs b/lemmy_db/src/source/private_message.rs index f474cf9ac..e2b55c879 100644 --- a/lemmy_db/src/source/private_message.rs +++ b/lemmy_db/src/source/private_message.rs @@ -1,5 +1,6 @@ -use crate::{naive_now, schema::private_message, ApubObject, Crud}; +use crate::{naive_now, ApubObject, Crud}; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::private_message; use serde::Serialize; #[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)] @@ -33,12 +34,12 @@ pub struct PrivateMessageForm { impl Crud for PrivateMessage { fn read(conn: &PgConnection, private_message_id: i32) -> Result { - use crate::schema::private_message::dsl::*; + use lemmy_db_schema::schema::private_message::dsl::*; private_message.find(private_message_id).first::(conn) } fn create(conn: &PgConnection, private_message_form: &PrivateMessageForm) -> Result { - use crate::schema::private_message::dsl::*; + use lemmy_db_schema::schema::private_message::dsl::*; insert_into(private_message) .values(private_message_form) .get_result::(conn) @@ -49,7 +50,7 @@ impl Crud for PrivateMessage { private_message_id: i32, private_message_form: &PrivateMessageForm, ) -> Result { - use crate::schema::private_message::dsl::*; + use lemmy_db_schema::schema::private_message::dsl::*; diesel::update(private_message.find(private_message_id)) .set(private_message_form) .get_result::(conn) @@ -61,14 +62,14 @@ impl ApubObject for PrivateMessage { where Self: Sized, { - use crate::schema::private_message::dsl::*; + use lemmy_db_schema::schema::private_message::dsl::*; private_message .filter(ap_id.eq(object_id)) .first::(conn) } fn upsert(conn: &PgConnection, private_message_form: &PrivateMessageForm) -> Result { - use crate::schema::private_message::dsl::*; + use lemmy_db_schema::schema::private_message::dsl::*; insert_into(private_message) .values(private_message_form) .on_conflict(ap_id) @@ -84,7 +85,7 @@ impl PrivateMessage { private_message_id: i32, apub_id: String, ) -> Result { - use crate::schema::private_message::dsl::*; + use lemmy_db_schema::schema::private_message::dsl::*; diesel::update(private_message.find(private_message_id)) .set(ap_id.eq(apub_id)) @@ -96,7 +97,7 @@ impl PrivateMessage { private_message_id: i32, new_content: &str, ) -> Result { - use crate::schema::private_message::dsl::*; + use lemmy_db_schema::schema::private_message::dsl::*; diesel::update(private_message.find(private_message_id)) .set((content.eq(new_content), updated.eq(naive_now()))) .get_result::(conn) @@ -107,7 +108,7 @@ impl PrivateMessage { private_message_id: i32, new_deleted: bool, ) -> Result { - use crate::schema::private_message::dsl::*; + use lemmy_db_schema::schema::private_message::dsl::*; diesel::update(private_message.find(private_message_id)) .set(deleted.eq(new_deleted)) .get_result::(conn) @@ -118,14 +119,14 @@ impl PrivateMessage { private_message_id: i32, new_read: bool, ) -> Result { - use crate::schema::private_message::dsl::*; + use lemmy_db_schema::schema::private_message::dsl::*; diesel::update(private_message.find(private_message_id)) .set(read.eq(new_read)) .get_result::(conn) } pub fn mark_all_as_read(conn: &PgConnection, for_recipient_id: i32) -> Result, Error> { - use crate::schema::private_message::dsl::*; + use lemmy_db_schema::schema::private_message::dsl::*; diesel::update( private_message .filter(recipient_id.eq(for_recipient_id)) diff --git a/lemmy_db/src/source/site.rs b/lemmy_db/src/source/site.rs index 2f3fbcdff..ad6f9ea6f 100644 --- a/lemmy_db/src/source/site.rs +++ b/lemmy_db/src/source/site.rs @@ -1,5 +1,6 @@ -use crate::{naive_now, schema::site, Crud}; +use crate::{naive_now, Crud}; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::site; use serde::Serialize; #[derive(Queryable, Identifiable, PartialEq, Debug, Clone, Serialize)] @@ -35,17 +36,17 @@ pub struct SiteForm { impl Crud for Site { fn read(conn: &PgConnection, _site_id: i32) -> Result { - use crate::schema::site::dsl::*; + use lemmy_db_schema::schema::site::dsl::*; site.first::(conn) } fn create(conn: &PgConnection, new_site: &SiteForm) -> Result { - use crate::schema::site::dsl::*; + use lemmy_db_schema::schema::site::dsl::*; insert_into(site).values(new_site).get_result::(conn) } fn update(conn: &PgConnection, site_id: i32, new_site: &SiteForm) -> Result { - use crate::schema::site::dsl::*; + use lemmy_db_schema::schema::site::dsl::*; diesel::update(site.find(site_id)) .set(new_site) .get_result::(conn) @@ -54,7 +55,7 @@ impl Crud for Site { impl Site { pub fn transfer(conn: &PgConnection, new_creator_id: i32) -> Result { - use crate::schema::site::dsl::*; + use lemmy_db_schema::schema::site::dsl::*; diesel::update(site.find(1)) .set((creator_id.eq(new_creator_id), updated.eq(naive_now()))) .get_result::(conn) diff --git a/lemmy_db/src/source/user.rs b/lemmy_db/src/source/user.rs index 601e6e8c6..809a579af 100644 --- a/lemmy_db/src/source/user.rs +++ b/lemmy_db/src/source/user.rs @@ -1,12 +1,7 @@ -use crate::{ - is_email_regex, - naive_now, - schema::{user_, user_::dsl::*, user_alias_1, user_alias_2}, - ApubObject, - Crud, -}; +use crate::{is_email_regex, naive_now, ApubObject, Crud}; use bcrypt::{hash, DEFAULT_COST}; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::{user_, user_::dsl::*, user_alias_1, user_alias_2}; use lemmy_utils::settings::Settings; use serde::Serialize; @@ -62,7 +57,8 @@ pub struct UserSafe { } mod safe_type { - use crate::{schema::user_::columns::*, source::user::User_, ToSafe}; + use crate::{source::user::User_, ToSafe}; + use lemmy_db_schema::schema::user_::columns::*; type Columns = ( id, name, @@ -154,7 +150,8 @@ pub struct UserSafeAlias1 { } mod safe_type_alias_1 { - use crate::{schema::user_alias_1::columns::*, source::user::UserAlias1, ToSafe}; + use crate::{source::user::UserAlias1, ToSafe}; + use lemmy_db_schema::schema::user_alias_1::columns::*; type Columns = ( id, name, @@ -246,7 +243,8 @@ pub struct UserSafeAlias2 { } mod safe_type_alias_2 { - use crate::{schema::user_alias_2::columns::*, source::user::UserAlias2, ToSafe}; + use crate::{source::user::UserAlias2, ToSafe}; + use lemmy_db_schema::schema::user_alias_2::columns::*; type Columns = ( id, name, @@ -338,7 +336,7 @@ impl Crud for User_ { impl ApubObject for User_ { fn read_from_apub_id(conn: &PgConnection, object_id: &str) -> Result { - use crate::schema::user_::dsl::*; + use lemmy_db_schema::schema::user_::dsl::*; user_ .filter(deleted.eq(false)) .filter(actor_id.eq(object_id)) diff --git a/lemmy_db/src/source/user_mention.rs b/lemmy_db/src/source/user_mention.rs index bf53cb420..a61d08d2c 100644 --- a/lemmy_db/src/source/user_mention.rs +++ b/lemmy_db/src/source/user_mention.rs @@ -1,6 +1,7 @@ use super::comment::Comment; -use crate::{schema::user_mention, Crud}; +use crate::Crud; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::user_mention; use serde::Serialize; #[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)] @@ -24,12 +25,12 @@ pub struct UserMentionForm { impl Crud for UserMention { fn read(conn: &PgConnection, user_mention_id: i32) -> Result { - use crate::schema::user_mention::dsl::*; + use lemmy_db_schema::schema::user_mention::dsl::*; user_mention.find(user_mention_id).first::(conn) } fn create(conn: &PgConnection, user_mention_form: &UserMentionForm) -> Result { - use crate::schema::user_mention::dsl::*; + use lemmy_db_schema::schema::user_mention::dsl::*; // since the return here isnt utilized, we dont need to do an update // but get_result doesnt return the existing row here insert_into(user_mention) @@ -45,7 +46,7 @@ impl Crud for UserMention { user_mention_id: i32, user_mention_form: &UserMentionForm, ) -> Result { - use crate::schema::user_mention::dsl::*; + use lemmy_db_schema::schema::user_mention::dsl::*; diesel::update(user_mention.find(user_mention_id)) .set(user_mention_form) .get_result::(conn) @@ -58,14 +59,14 @@ impl UserMention { user_mention_id: i32, new_read: bool, ) -> Result { - use crate::schema::user_mention::dsl::*; + use lemmy_db_schema::schema::user_mention::dsl::*; diesel::update(user_mention.find(user_mention_id)) .set(read.eq(new_read)) .get_result::(conn) } pub fn mark_all_as_read(conn: &PgConnection, for_recipient_id: i32) -> Result, Error> { - use crate::schema::user_mention::dsl::*; + use lemmy_db_schema::schema::user_mention::dsl::*; diesel::update( user_mention .filter(recipient_id.eq(for_recipient_id)) diff --git a/lemmy_db/src/views/comment_report_view.rs b/lemmy_db/src/views/comment_report_view.rs index 540bb7569..0f55b4320 100644 --- a/lemmy_db/src/views/comment_report_view.rs +++ b/lemmy_db/src/views/comment_report_view.rs @@ -1,6 +1,5 @@ use crate::{ limit_and_offset, - schema::{comment, comment_report, community, post, user_, user_alias_1, user_alias_2}, source::{ comment::Comment, comment_report::CommentReport, @@ -13,6 +12,15 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{ + comment, + comment_report, + community, + post, + user_, + user_alias_1, + user_alias_2, +}; use serde::Serialize; #[derive(Debug, PartialEq, Serialize, Clone)] diff --git a/lemmy_db/src/views/comment_view.rs b/lemmy_db/src/views/comment_view.rs index d85f654fb..7f78c20f8 100644 --- a/lemmy_db/src/views/comment_view.rs +++ b/lemmy_db/src/views/comment_view.rs @@ -3,19 +3,6 @@ use crate::{ functions::hot_rank, fuzzy_search, limit_and_offset, - schema::{ - comment, - comment_aggregates, - comment_alias_1, - comment_like, - comment_saved, - community, - community_follower, - community_user_ban, - post, - user_, - user_alias_1, - }, source::{ comment::{Comment, CommentAlias1, CommentSaved}, community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, @@ -29,6 +16,19 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{ + comment, + comment_aggregates, + comment_alias_1, + comment_like, + comment_saved, + community, + community_follower, + community_user_ban, + post, + user_, + user_alias_1, +}; use serde::Serialize; #[derive(Debug, PartialEq, Serialize, Clone)] diff --git a/lemmy_db/src/views/community/community_follower_view.rs b/lemmy_db/src/views/community/community_follower_view.rs index 7de9cc3a4..243b91420 100644 --- a/lemmy_db/src/views/community/community_follower_view.rs +++ b/lemmy_db/src/views/community/community_follower_view.rs @@ -1,5 +1,4 @@ use crate::{ - schema::{community, community_follower, user_}, source::{ community::{Community, CommunitySafe}, user::{UserSafe, User_}, @@ -8,6 +7,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{community, community_follower, user_}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/community/community_moderator_view.rs b/lemmy_db/src/views/community/community_moderator_view.rs index 751e46232..8762b9750 100644 --- a/lemmy_db/src/views/community/community_moderator_view.rs +++ b/lemmy_db/src/views/community/community_moderator_view.rs @@ -1,5 +1,4 @@ use crate::{ - schema::{community, community_moderator, user_}, source::{ community::{Community, CommunitySafe}, user::{UserSafe, User_}, @@ -8,6 +7,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{community, community_moderator, user_}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/community/community_user_ban_view.rs b/lemmy_db/src/views/community/community_user_ban_view.rs index 3358f01b2..5dba4ebd3 100644 --- a/lemmy_db/src/views/community/community_user_ban_view.rs +++ b/lemmy_db/src/views/community/community_user_ban_view.rs @@ -1,5 +1,4 @@ use crate::{ - schema::{community, community_user_ban, user_}, source::{ community::{Community, CommunitySafe}, user::{UserSafe, User_}, @@ -7,6 +6,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{community, community_user_ban, user_}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/community/community_view.rs b/lemmy_db/src/views/community/community_view.rs index fcc707c06..6c951b337 100644 --- a/lemmy_db/src/views/community/community_view.rs +++ b/lemmy_db/src/views/community/community_view.rs @@ -3,7 +3,6 @@ use crate::{ functions::hot_rank, fuzzy_search, limit_and_offset, - schema::{category, community, community_aggregates, community_follower, user_}, source::{ category::Category, community::{Community, CommunityFollower, CommunitySafe}, @@ -15,6 +14,13 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{ + category, + community, + community_aggregates, + community_follower, + user_, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_add_community_view.rs b/lemmy_db/src/views/moderator/mod_add_community_view.rs index 402c5fe1b..1dd7cfc47 100644 --- a/lemmy_db/src/views/moderator/mod_add_community_view.rs +++ b/lemmy_db/src/views/moderator/mod_add_community_view.rs @@ -1,6 +1,5 @@ use crate::{ limit_and_offset, - schema::{community, mod_add_community, user_, user_alias_1}, source::{ community::{Community, CommunitySafe}, moderator::ModAddCommunity, @@ -10,6 +9,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{community, mod_add_community, user_, user_alias_1}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_add_view.rs b/lemmy_db/src/views/moderator/mod_add_view.rs index fc1993d45..06648ad76 100644 --- a/lemmy_db/src/views/moderator/mod_add_view.rs +++ b/lemmy_db/src/views/moderator/mod_add_view.rs @@ -1,6 +1,5 @@ use crate::{ limit_and_offset, - schema::{mod_add, user_, user_alias_1}, source::{ moderator::ModAdd, user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, @@ -9,6 +8,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{mod_add, user_, user_alias_1}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_ban_from_community_view.rs b/lemmy_db/src/views/moderator/mod_ban_from_community_view.rs index 6ad232e87..3992518bc 100644 --- a/lemmy_db/src/views/moderator/mod_ban_from_community_view.rs +++ b/lemmy_db/src/views/moderator/mod_ban_from_community_view.rs @@ -1,6 +1,5 @@ use crate::{ limit_and_offset, - schema::{community, mod_ban_from_community, user_, user_alias_1}, source::{ community::{Community, CommunitySafe}, moderator::ModBanFromCommunity, @@ -10,6 +9,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{community, mod_ban_from_community, user_, user_alias_1}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_ban_view.rs b/lemmy_db/src/views/moderator/mod_ban_view.rs index 28214d2da..52e890259 100644 --- a/lemmy_db/src/views/moderator/mod_ban_view.rs +++ b/lemmy_db/src/views/moderator/mod_ban_view.rs @@ -1,6 +1,5 @@ use crate::{ limit_and_offset, - schema::{mod_ban, user_, user_alias_1}, source::{ moderator::ModBan, user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, @@ -9,6 +8,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{mod_ban, user_, user_alias_1}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_lock_post_view.rs b/lemmy_db/src/views/moderator/mod_lock_post_view.rs index 8182b54f7..2d71a8819 100644 --- a/lemmy_db/src/views/moderator/mod_lock_post_view.rs +++ b/lemmy_db/src/views/moderator/mod_lock_post_view.rs @@ -1,6 +1,5 @@ use crate::{ limit_and_offset, - schema::{community, mod_lock_post, post, user_}, source::{ community::{Community, CommunitySafe}, moderator::ModLockPost, @@ -11,6 +10,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{community, mod_lock_post, post, user_}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_remove_comment_view.rs b/lemmy_db/src/views/moderator/mod_remove_comment_view.rs index fb4b77724..4fa82eed2 100644 --- a/lemmy_db/src/views/moderator/mod_remove_comment_view.rs +++ b/lemmy_db/src/views/moderator/mod_remove_comment_view.rs @@ -1,6 +1,5 @@ use crate::{ limit_and_offset, - schema::{comment, community, mod_remove_comment, post, user_, user_alias_1}, source::{ comment::Comment, community::{Community, CommunitySafe}, @@ -12,6 +11,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{comment, community, mod_remove_comment, post, user_, user_alias_1}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_remove_community_view.rs b/lemmy_db/src/views/moderator/mod_remove_community_view.rs index daaf6d78f..1700ac2d9 100644 --- a/lemmy_db/src/views/moderator/mod_remove_community_view.rs +++ b/lemmy_db/src/views/moderator/mod_remove_community_view.rs @@ -1,6 +1,5 @@ use crate::{ limit_and_offset, - schema::{community, mod_remove_community, user_}, source::{ community::{Community, CommunitySafe}, moderator::ModRemoveCommunity, @@ -10,6 +9,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{community, mod_remove_community, user_}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_remove_post_view.rs b/lemmy_db/src/views/moderator/mod_remove_post_view.rs index 613a8a541..d21e985cd 100644 --- a/lemmy_db/src/views/moderator/mod_remove_post_view.rs +++ b/lemmy_db/src/views/moderator/mod_remove_post_view.rs @@ -1,6 +1,5 @@ use crate::{ limit_and_offset, - schema::{community, mod_remove_post, post, user_}, source::{ community::{Community, CommunitySafe}, moderator::ModRemovePost, @@ -11,6 +10,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{community, mod_remove_post, post, user_}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_sticky_post_view.rs b/lemmy_db/src/views/moderator/mod_sticky_post_view.rs index 9a3d118b9..ec2771592 100644 --- a/lemmy_db/src/views/moderator/mod_sticky_post_view.rs +++ b/lemmy_db/src/views/moderator/mod_sticky_post_view.rs @@ -1,6 +1,5 @@ use crate::{ limit_and_offset, - schema::{community, mod_sticky_post, post, user_}, source::{ community::{Community, CommunitySafe}, moderator::ModStickyPost, @@ -11,6 +10,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{community, mod_sticky_post, post, user_}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/post_report_view.rs b/lemmy_db/src/views/post_report_view.rs index d39adfd5c..75bfac954 100644 --- a/lemmy_db/src/views/post_report_view.rs +++ b/lemmy_db/src/views/post_report_view.rs @@ -1,6 +1,5 @@ use crate::{ limit_and_offset, - schema::{community, post, post_report, user_, user_alias_1, user_alias_2}, source::{ community::{Community, CommunitySafe}, post::Post, @@ -12,6 +11,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{community, post, post_report, user_, user_alias_1, user_alias_2}; use serde::Serialize; #[derive(Debug, PartialEq, Serialize, Clone)] diff --git a/lemmy_db/src/views/post_view.rs b/lemmy_db/src/views/post_view.rs index f95cf1184..25d86aa16 100644 --- a/lemmy_db/src/views/post_view.rs +++ b/lemmy_db/src/views/post_view.rs @@ -3,17 +3,6 @@ use crate::{ functions::hot_rank, fuzzy_search, limit_and_offset, - schema::{ - community, - community_follower, - community_user_ban, - post, - post_aggregates, - post_like, - post_read, - post_saved, - user_, - }, source::{ community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, post::{Post, PostRead, PostSaved}, @@ -26,6 +15,17 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{ + community, + community_follower, + community_user_ban, + post, + post_aggregates, + post_like, + post_read, + post_saved, + user_, +}; use serde::Serialize; #[derive(Debug, PartialEq, Serialize, Clone)] diff --git a/lemmy_db/src/views/private_message_view.rs b/lemmy_db/src/views/private_message_view.rs index 43d960a8a..5d594b12e 100644 --- a/lemmy_db/src/views/private_message_view.rs +++ b/lemmy_db/src/views/private_message_view.rs @@ -1,6 +1,5 @@ use crate::{ limit_and_offset, - schema::{private_message, user_, user_alias_1}, source::{ private_message::PrivateMessage, user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, @@ -10,6 +9,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{private_message, user_, user_alias_1}; use serde::Serialize; #[derive(Debug, PartialEq, Serialize, Clone)] diff --git a/lemmy_db/src/views/site_view.rs b/lemmy_db/src/views/site_view.rs index d10702fca..d956e2e1a 100644 --- a/lemmy_db/src/views/site_view.rs +++ b/lemmy_db/src/views/site_view.rs @@ -1,5 +1,4 @@ use crate::{ - schema::{site, user_}, source::{ site::Site, user::{UserSafe, User_}, @@ -7,6 +6,7 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{site, user_}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/user_mention_view.rs b/lemmy_db/src/views/user_mention_view.rs index 67616fbc3..bb5fa0093 100644 --- a/lemmy_db/src/views/user_mention_view.rs +++ b/lemmy_db/src/views/user_mention_view.rs @@ -2,19 +2,6 @@ use crate::{ aggregates::comment_aggregates::CommentAggregates, functions::hot_rank, limit_and_offset, - schema::{ - comment, - comment_aggregates, - comment_like, - comment_saved, - community, - community_follower, - community_user_ban, - post, - user_, - user_alias_1, - user_mention, - }, source::{ comment::{Comment, CommentSaved}, community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, @@ -28,6 +15,19 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; +use lemmy_db_schema::schema::{ + comment, + comment_aggregates, + comment_like, + comment_saved, + community, + community_follower, + community_user_ban, + post, + user_, + user_alias_1, + user_mention, +}; use serde::Serialize; #[derive(Debug, PartialEq, Serialize, Clone)] diff --git a/lemmy_db/src/views/user_view.rs b/lemmy_db/src/views/user_view.rs index 587ebf617..8f59691a6 100644 --- a/lemmy_db/src/views/user_view.rs +++ b/lemmy_db/src/views/user_view.rs @@ -2,7 +2,6 @@ use crate::{ aggregates::user_aggregates::UserAggregates, fuzzy_search, limit_and_offset, - schema::{user_, user_aggregates}, source::user::{UserSafe, User_}, views::ViewToVec, MaybeOptional, @@ -10,6 +9,7 @@ use crate::{ ToSafe, }; use diesel::{dsl::*, result::Error, *}; +use lemmy_db_schema::schema::{user_, user_aggregates}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db_schema/Cargo.toml b/lemmy_db_schema/Cargo.toml new file mode 100644 index 000000000..3ef975505 --- /dev/null +++ b/lemmy_db_schema/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "lemmy_db_schema" +version = "0.1.0" +edition = "2018" + +[dependencies] +diesel = { version = "1.4.5", features = ["postgres","chrono","r2d2","serde_json"] } diff --git a/lemmy_db_schema/src/lib.rs b/lemmy_db_schema/src/lib.rs new file mode 100644 index 000000000..b37d94611 --- /dev/null +++ b/lemmy_db_schema/src/lib.rs @@ -0,0 +1,4 @@ +#[macro_use] +extern crate diesel; + +pub mod schema; diff --git a/lemmy_db/src/schema.rs b/lemmy_db_schema/src/schema.rs similarity index 100% rename from lemmy_db/src/schema.rs rename to lemmy_db_schema/src/schema.rs diff --git a/src/code_migrations.rs b/src/code_migrations.rs index 7a749e9b4..6a39d0dad 100644 --- a/src/code_migrations.rs +++ b/src/code_migrations.rs @@ -33,7 +33,7 @@ pub fn run_advanced_migrations(conn: &PgConnection) -> Result<(), LemmyError> { } fn user_updates_2020_04_02(conn: &PgConnection) -> Result<(), LemmyError> { - use lemmy_db::schema::user_::dsl::*; + use lemmy_db_schema::schema::user_::dsl::*; info!("Running user_updates_2020_04_02"); @@ -86,7 +86,7 @@ fn user_updates_2020_04_02(conn: &PgConnection) -> Result<(), LemmyError> { } fn community_updates_2020_04_02(conn: &PgConnection) -> Result<(), LemmyError> { - use lemmy_db::schema::community::dsl::*; + use lemmy_db_schema::schema::community::dsl::*; info!("Running community_updates_2020_04_02"); @@ -132,7 +132,7 @@ fn community_updates_2020_04_02(conn: &PgConnection) -> Result<(), LemmyError> { } fn post_updates_2020_04_03(conn: &PgConnection) -> Result<(), LemmyError> { - use lemmy_db::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; info!("Running post_updates_2020_04_03"); @@ -157,7 +157,7 @@ fn post_updates_2020_04_03(conn: &PgConnection) -> Result<(), LemmyError> { } fn comment_updates_2020_04_03(conn: &PgConnection) -> Result<(), LemmyError> { - use lemmy_db::schema::comment::dsl::*; + use lemmy_db_schema::schema::comment::dsl::*; info!("Running comment_updates_2020_04_03"); @@ -182,7 +182,7 @@ fn comment_updates_2020_04_03(conn: &PgConnection) -> Result<(), LemmyError> { } fn private_message_updates_2020_05_05(conn: &PgConnection) -> Result<(), LemmyError> { - use lemmy_db::schema::private_message::dsl::*; + use lemmy_db_schema::schema::private_message::dsl::*; info!("Running private_message_updates_2020_05_05"); @@ -203,7 +203,7 @@ fn private_message_updates_2020_05_05(conn: &PgConnection) -> Result<(), LemmyEr } fn post_thumbnail_url_updates_2020_07_27(conn: &PgConnection) -> Result<(), LemmyError> { - use lemmy_db::schema::post::dsl::*; + use lemmy_db_schema::schema::post::dsl::*; info!("Running post_thumbnail_url_updates_2020_07_27"); From 114f3cbfb5fc7b752fe52fa47143518c2a1172fb Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 18 Dec 2020 18:27:25 +0100 Subject: [PATCH 2/6] Move comment, post definitions into lemmy_db_schema --- Cargo.lock | 9 + lemmy_api/Cargo.toml | 1 + lemmy_api/src/comment.rs | 6 +- lemmy_api/src/community.rs | 7 +- lemmy_api/src/lib.rs | 2 +- lemmy_api/src/post.rs | 6 +- lemmy_api/src/site.rs | 2 +- lemmy_api/src/user.rs | 7 +- lemmy_apub/Cargo.toml | 1 + lemmy_apub/src/activities/receive/comment.rs | 11 +- .../src/activities/receive/comment_undo.rs | 7 +- lemmy_apub/src/activities/receive/post.rs | 7 +- .../src/activities/receive/post_undo.rs | 7 +- lemmy_apub/src/activities/send/comment.rs | 3 +- lemmy_apub/src/activities/send/post.rs | 3 +- lemmy_apub/src/fetcher.rs | 7 +- lemmy_apub/src/http/comment.rs | 3 +- lemmy_apub/src/http/community.rs | 3 +- lemmy_apub/src/http/post.rs | 2 +- lemmy_apub/src/inbox/receive_for_community.rs | 7 +- lemmy_apub/src/objects/comment.rs | 11 +- lemmy_apub/src/objects/community.rs | 2 +- lemmy_apub/src/objects/post.rs | 7 +- lemmy_apub/src/objects/user.rs | 2 +- .../src/aggregates/community_aggregates.rs | 6 +- lemmy_db/src/aggregates/post_aggregates.rs | 6 +- lemmy_db/src/aggregates/site_aggregates.rs | 6 +- lemmy_db/src/aggregates/user_aggregates.rs | 6 +- lemmy_db/src/lib.rs | 5 - lemmy_db/src/source/comment.rs | 201 +-------------- lemmy_db/src/source/comment_report.rs | 4 +- lemmy_db/src/source/community.rs | 9 +- lemmy_db/src/source/moderator.rs | 3 +- lemmy_db/src/source/post.rs | 237 +----------------- lemmy_db/src/source/post_report.rs | 4 +- lemmy_db/src/source/private_message.rs | 4 +- lemmy_db/src/source/site.rs | 4 +- lemmy_db/src/source/user.rs | 7 +- lemmy_db/src/source/user_mention.rs | 6 +- lemmy_db/src/views/comment_report_view.rs | 13 +- lemmy_db/src/views/comment_view.rs | 35 +-- .../src/views/moderator/mod_lock_post_view.rs | 6 +- .../moderator/mod_remove_comment_view.rs | 7 +- .../views/moderator/mod_remove_post_view.rs | 6 +- .../views/moderator/mod_sticky_post_view.rs | 6 +- lemmy_db/src/views/post_report_view.rs | 6 +- lemmy_db/src/views/post_view.rs | 27 +- lemmy_db/src/views/user_mention_view.rs | 32 +-- lemmy_db_schema/Cargo.toml | 5 + lemmy_db_schema/src/lib.rs | 7 + lemmy_db_schema/src/source/comment.rs | 190 ++++++++++++++ lemmy_db_schema/src/source/mod.rs | 2 + lemmy_db_schema/src/source/post.rs | 229 +++++++++++++++++ lemmy_structs/Cargo.toml | 1 + lemmy_structs/src/lib.rs | 3 +- lemmy_websocket/Cargo.toml | 1 + lemmy_websocket/src/handlers.rs | 2 +- src/code_migrations.rs | 7 +- 58 files changed, 642 insertions(+), 574 deletions(-) create mode 100644 lemmy_db_schema/src/source/comment.rs create mode 100644 lemmy_db_schema/src/source/mod.rs create mode 100644 lemmy_db_schema/src/source/post.rs diff --git a/Cargo.lock b/Cargo.lock index 850a19e5e..6cc79fedd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1718,6 +1718,7 @@ dependencies = [ "lazy_static", "lemmy_apub", "lemmy_db", + "lemmy_db_schema", "lemmy_rate_limit", "lemmy_structs", "lemmy_utils", @@ -1762,6 +1763,7 @@ dependencies = [ "itertools", "lazy_static", "lemmy_db", + "lemmy_db_schema", "lemmy_structs", "lemmy_utils", "lemmy_websocket", @@ -1805,7 +1807,12 @@ dependencies = [ name = "lemmy_db_schema" version = "0.1.0" dependencies = [ + "chrono", "diesel", + "log", + "serde 1.0.118", + "serde_json", + "url", ] [[package]] @@ -1868,6 +1875,7 @@ dependencies = [ "chrono", "diesel", "lemmy_db", + "lemmy_db_schema", "lemmy_utils", "log", "serde 1.0.118", @@ -1909,6 +1917,7 @@ dependencies = [ "chrono", "diesel", "lemmy_db", + "lemmy_db_schema", "lemmy_rate_limit", "lemmy_structs", "lemmy_utils", diff --git a/lemmy_api/Cargo.toml b/lemmy_api/Cargo.toml index 94fd2d500..f4a10924c 100644 --- a/lemmy_api/Cargo.toml +++ b/lemmy_api/Cargo.toml @@ -12,6 +12,7 @@ path = "src/lib.rs" lemmy_apub = { path = "../lemmy_apub" } lemmy_utils = { path = "../lemmy_utils" } lemmy_db = { path = "../lemmy_db" } +lemmy_db_schema = { path = "../lemmy_db_schema" } lemmy_structs = { path = "../lemmy_structs" } lemmy_rate_limit = { path = "../lemmy_rate_limit" } lemmy_websocket = { path = "../lemmy_websocket" } diff --git a/lemmy_api/src/comment.rs b/lemmy_api/src/comment.rs index 689fe4b8a..acff60042 100644 --- a/lemmy_api/src/comment.rs +++ b/lemmy_api/src/comment.rs @@ -11,10 +11,8 @@ use actix_web::web::Data; use lemmy_apub::{ApubLikeableType, ApubObjectType}; use lemmy_db::{ source::{ - comment::*, comment_report::{CommentReport, CommentReportForm}, moderator::*, - post::*, user::*, }, views::{ @@ -29,6 +27,10 @@ use lemmy_db::{ Saveable, SortType, }; +use lemmy_db_schema::source::{ + comment::{Comment, CommentForm, CommentLike, CommentLikeForm, CommentSaved, CommentSavedForm}, + post::Post, +}; use lemmy_structs::{blocking, comment::*, send_local_notifs}; use lemmy_utils::{ apub::{make_apub_endpoint, EndpointType}, diff --git a/lemmy_api/src/community.rs b/lemmy_api/src/community.rs index 6e20a30ba..35aafc88e 100644 --- a/lemmy_api/src/community.rs +++ b/lemmy_api/src/community.rs @@ -11,8 +11,7 @@ use anyhow::Context; use lemmy_apub::ActorType; use lemmy_db::{ diesel_option_overwrite, - naive_now, - source::{comment::Comment, community::*, moderator::*, post::Post, site::*}, + source::{community::*, moderator::*, site::*}, views::{ comment_view::CommentQueryBuilder, community::{ @@ -29,6 +28,10 @@ use lemmy_db::{ Joinable, SortType, }; +use lemmy_db_schema::{ + naive_now, + source::{comment::Comment, post::Post}, +}; use lemmy_structs::{blocking, community::*}; use lemmy_utils::{ apub::{generate_actor_keypair, make_apub_endpoint, EndpointType}, diff --git a/lemmy_api/src/lib.rs b/lemmy_api/src/lib.rs index ad7355e1c..927846c0a 100644 --- a/lemmy_api/src/lib.rs +++ b/lemmy_api/src/lib.rs @@ -3,13 +3,13 @@ use actix_web::{web, web::Data}; use lemmy_db::{ source::{ community::{Community, CommunityModerator}, - post::Post, user::User_, }, views::community::community_user_ban_view::CommunityUserBanView, Crud, DbPool, }; +use lemmy_db_schema::source::post::Post; use lemmy_structs::{blocking, comment::*, community::*, post::*, site::*, user::*}; use lemmy_utils::{settings::Settings, APIError, ConnectionId, LemmyError}; use lemmy_websocket::{serialize_websocket_message, LemmyContext, UserOperation}; diff --git a/lemmy_api/src/post.rs b/lemmy_api/src/post.rs index 22f95877a..ee09059a5 100644 --- a/lemmy_api/src/post.rs +++ b/lemmy_api/src/post.rs @@ -10,10 +10,8 @@ use crate::{ use actix_web::web::Data; use lemmy_apub::{ApubLikeableType, ApubObjectType}; use lemmy_db::{ - naive_now, source::{ moderator::*, - post::*, post_report::{PostReport, PostReportForm}, }, views::{ @@ -30,6 +28,10 @@ use lemmy_db::{ Saveable, SortType, }; +use lemmy_db_schema::{ + naive_now, + source::post::{Post, PostForm, PostLike, PostLikeForm, PostSaved, PostSavedForm}, +}; use lemmy_structs::{blocking, post::*}; use lemmy_utils::{ apub::{make_apub_endpoint, EndpointType}, diff --git a/lemmy_api/src/site.rs b/lemmy_api/src/site.rs index 138cc8751..8eda284f6 100644 --- a/lemmy_api/src/site.rs +++ b/lemmy_api/src/site.rs @@ -12,7 +12,6 @@ use lemmy_apub::fetcher::search_by_apub_id; use lemmy_db::{ aggregates::site_aggregates::SiteAggregates, diesel_option_overwrite, - naive_now, source::{category::*, moderator::*, site::*}, views::{ comment_view::CommentQueryBuilder, @@ -36,6 +35,7 @@ use lemmy_db::{ SearchType, SortType, }; +use lemmy_db_schema::naive_now; use lemmy_structs::{blocking, site::*, user::Register}; use lemmy_utils::{ location_info, diff --git a/lemmy_api/src/user.rs b/lemmy_api/src/user.rs index f31e42e5a..680910b84 100644 --- a/lemmy_api/src/user.rs +++ b/lemmy_api/src/user.rs @@ -16,13 +16,10 @@ use chrono::Duration; use lemmy_apub::ApubObjectType; use lemmy_db::{ diesel_option_overwrite, - naive_now, source::{ - comment::*, community::*, moderator::*, password_reset_request::*, - post::*, private_message::*, site::*, user::*, @@ -48,6 +45,10 @@ use lemmy_db::{ ListingType, SortType, }; +use lemmy_db_schema::{ + naive_now, + source::{comment::Comment, post::Post}, +}; use lemmy_structs::{blocking, send_email_to_user, user::*}; use lemmy_utils::{ apub::{generate_actor_keypair, make_apub_endpoint, EndpointType}, diff --git a/lemmy_apub/Cargo.toml b/lemmy_apub/Cargo.toml index 2dd9a64a4..e62ae9f0c 100644 --- a/lemmy_apub/Cargo.toml +++ b/lemmy_apub/Cargo.toml @@ -11,6 +11,7 @@ path = "src/lib.rs" [dependencies] lemmy_utils = { path = "../lemmy_utils" } lemmy_db = { path = "../lemmy_db" } +lemmy_db_schema = { path = "../lemmy_db_schema" } lemmy_structs = { path = "../lemmy_structs" } lemmy_websocket = { path = "../lemmy_websocket" } diesel = "1.4.5" diff --git a/lemmy_apub/src/activities/receive/comment.rs b/lemmy_apub/src/activities/receive/comment.rs index 700a2653c..76337c4fd 100644 --- a/lemmy_apub/src/activities/receive/comment.rs +++ b/lemmy_apub/src/activities/receive/comment.rs @@ -4,13 +4,10 @@ use activitystreams::{ base::ExtendsExt, }; use anyhow::Context; -use lemmy_db::{ - source::{ - comment::{Comment, CommentLike, CommentLikeForm}, - post::Post, - }, - views::comment_view::CommentView, - Likeable, +use lemmy_db::{views::comment_view::CommentView, Likeable}; +use lemmy_db_schema::source::{ + comment::{Comment, CommentLike, CommentLikeForm}, + post::Post, }; use lemmy_structs::{blocking, comment::CommentResponse, send_local_notifs}; use lemmy_utils::{location_info, utils::scrape_text_for_mentions, LemmyError}; diff --git a/lemmy_apub/src/activities/receive/comment_undo.rs b/lemmy_apub/src/activities/receive/comment_undo.rs index 85dcc143d..f446b2860 100644 --- a/lemmy_apub/src/activities/receive/comment_undo.rs +++ b/lemmy_apub/src/activities/receive/comment_undo.rs @@ -1,10 +1,7 @@ use crate::activities::receive::get_actor_as_user; use activitystreams::activity::{Dislike, Like}; -use lemmy_db::{ - source::comment::{Comment, CommentLike}, - views::comment_view::CommentView, - Likeable, -}; +use lemmy_db::{views::comment_view::CommentView, Likeable}; +use lemmy_db_schema::source::comment::{Comment, CommentLike}; use lemmy_structs::{blocking, comment::CommentResponse}; use lemmy_utils::LemmyError; use lemmy_websocket::{messages::SendComment, LemmyContext, UserOperation}; diff --git a/lemmy_apub/src/activities/receive/post.rs b/lemmy_apub/src/activities/receive/post.rs index f09071129..4a3cc13f7 100644 --- a/lemmy_apub/src/activities/receive/post.rs +++ b/lemmy_apub/src/activities/receive/post.rs @@ -4,11 +4,8 @@ use activitystreams::{ prelude::*, }; use anyhow::Context; -use lemmy_db::{ - source::post::{Post, PostLike, PostLikeForm}, - views::post_view::PostView, - Likeable, -}; +use lemmy_db::{views::post_view::PostView, Likeable}; +use lemmy_db_schema::source::post::{Post, PostLike, PostLikeForm}; use lemmy_structs::{blocking, post::PostResponse}; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::{messages::SendPost, LemmyContext, UserOperation}; diff --git a/lemmy_apub/src/activities/receive/post_undo.rs b/lemmy_apub/src/activities/receive/post_undo.rs index 6827ded05..817a74e41 100644 --- a/lemmy_apub/src/activities/receive/post_undo.rs +++ b/lemmy_apub/src/activities/receive/post_undo.rs @@ -1,10 +1,7 @@ use crate::activities::receive::get_actor_as_user; use activitystreams::activity::{Dislike, Like}; -use lemmy_db::{ - source::post::{Post, PostLike}, - views::post_view::PostView, - Likeable, -}; +use lemmy_db::{views::post_view::PostView, Likeable}; +use lemmy_db_schema::source::post::{Post, PostLike}; use lemmy_structs::{blocking, post::PostResponse}; use lemmy_utils::LemmyError; use lemmy_websocket::{messages::SendPost, LemmyContext, UserOperation}; diff --git a/lemmy_apub/src/activities/send/comment.rs b/lemmy_apub/src/activities/send/comment.rs index 6b417c259..358e5020a 100644 --- a/lemmy_apub/src/activities/send/comment.rs +++ b/lemmy_apub/src/activities/send/comment.rs @@ -27,10 +27,11 @@ use activitystreams::{ use anyhow::anyhow; use itertools::Itertools; use lemmy_db::{ - source::{comment::Comment, community::Community, post::Post, user::User_}, + source::{community::Community, user::User_}, Crud, DbPool, }; +use lemmy_db_schema::source::{comment::Comment, post::Post}; use lemmy_structs::{blocking, WebFingerResponse}; use lemmy_utils::{ request::{retry, RecvError}, diff --git a/lemmy_apub/src/activities/send/post.rs b/lemmy_apub/src/activities/send/post.rs index ec1ca67de..fd7f7c12a 100644 --- a/lemmy_apub/src/activities/send/post.rs +++ b/lemmy_apub/src/activities/send/post.rs @@ -22,9 +22,10 @@ use activitystreams::{ public, }; use lemmy_db::{ - source::{community::Community, post::Post, user::User_}, + source::{community::Community, user::User_}, Crud, }; +use lemmy_db_schema::source::post::Post; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/fetcher.rs b/lemmy_apub/src/fetcher.rs index 61cdbd47a..d06b221e2 100644 --- a/lemmy_apub/src/fetcher.rs +++ b/lemmy_apub/src/fetcher.rs @@ -13,11 +13,8 @@ use anyhow::{anyhow, Context}; use chrono::NaiveDateTime; use diesel::result::Error::NotFound; use lemmy_db::{ - naive_now, source::{ - comment::Comment, community::{Community, CommunityModerator, CommunityModeratorForm}, - post::Post, user::User_, }, views::{ @@ -30,6 +27,10 @@ use lemmy_db::{ Joinable, SearchType, }; +use lemmy_db_schema::{ + naive_now, + source::{comment::Comment, post::Post}, +}; use lemmy_structs::{blocking, site::SearchResponse}; use lemmy_utils::{ location_info, diff --git a/lemmy_apub/src/http/comment.rs b/lemmy_apub/src/http/comment.rs index 16f411902..f71d542b0 100644 --- a/lemmy_apub/src/http/comment.rs +++ b/lemmy_apub/src/http/comment.rs @@ -4,7 +4,8 @@ use crate::{ }; use actix_web::{body::Body, web, web::Path, HttpResponse}; use diesel::result::Error::NotFound; -use lemmy_db::{source::comment::Comment, Crud}; +use lemmy_db::Crud; +use lemmy_db_schema::source::comment::Comment; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/http/community.rs b/lemmy_apub/src/http/community.rs index a17e2abf9..a1a7870f0 100644 --- a/lemmy_apub/src/http/community.rs +++ b/lemmy_apub/src/http/community.rs @@ -10,9 +10,10 @@ use activitystreams::{ }; use actix_web::{body::Body, web, HttpResponse}; use lemmy_db::{ - source::{community::Community, post::Post}, + source::community::Community, views::community::community_follower_view::CommunityFollowerView, }; +use lemmy_db_schema::source::post::Post; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/http/post.rs b/lemmy_apub/src/http/post.rs index 563af8456..ad8464076 100644 --- a/lemmy_apub/src/http/post.rs +++ b/lemmy_apub/src/http/post.rs @@ -4,7 +4,7 @@ use crate::{ }; use actix_web::{body::Body, web, HttpResponse}; use diesel::result::Error::NotFound; -use lemmy_db::source::post::Post; +use lemmy_db_schema::source::post::Post; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/inbox/receive_for_community.rs b/lemmy_apub/src/inbox/receive_for_community.rs index 73deb9717..995a13995 100644 --- a/lemmy_apub/src/inbox/receive_for_community.rs +++ b/lemmy_apub/src/inbox/receive_for_community.rs @@ -41,11 +41,8 @@ use activitystreams::{ }; use anyhow::Context; use diesel::result::Error::NotFound; -use lemmy_db::{ - source::{comment::Comment, post::Post, site::Site}, - ApubObject, - Crud, -}; +use lemmy_db::{source::site::Site, ApubObject, Crud}; +use lemmy_db_schema::source::{comment::Comment, post::Post}; use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/objects/comment.rs b/lemmy_apub/src/objects/comment.rs index 957966d7f..9dd035c5d 100644 --- a/lemmy_apub/src/objects/comment.rs +++ b/lemmy_apub/src/objects/comment.rs @@ -24,15 +24,14 @@ use activitystreams::{ }; use anyhow::{anyhow, Context}; use lemmy_db::{ - source::{ - comment::{Comment, CommentForm}, - community::Community, - post::Post, - user::User_, - }, + source::{community::Community, user::User_}, Crud, DbPool, }; +use lemmy_db_schema::source::{ + comment::{Comment, CommentForm}, + post::Post, +}; use lemmy_structs::blocking; use lemmy_utils::{ location_info, diff --git a/lemmy_apub/src/objects/community.rs b/lemmy_apub/src/objects/community.rs index 9d8210a6a..f5fa2c318 100644 --- a/lemmy_apub/src/objects/community.rs +++ b/lemmy_apub/src/objects/community.rs @@ -23,11 +23,11 @@ use activitystreams::{ use activitystreams_ext::Ext2; use anyhow::Context; use lemmy_db::{ - naive_now, source::community::{Community, CommunityForm}, views::community::community_moderator_view::CommunityModeratorView, DbPool, }; +use lemmy_db_schema::naive_now; use lemmy_structs::blocking; use lemmy_utils::{ location_info, diff --git a/lemmy_apub/src/objects/post.rs b/lemmy_apub/src/objects/post.rs index 9c9df5b19..7090cd163 100644 --- a/lemmy_apub/src/objects/post.rs +++ b/lemmy_apub/src/objects/post.rs @@ -21,14 +21,11 @@ use activitystreams::{ use activitystreams_ext::Ext1; use anyhow::Context; use lemmy_db::{ - source::{ - community::Community, - post::{Post, PostForm}, - user::User_, - }, + source::{community::Community, user::User_}, Crud, DbPool, }; +use lemmy_db_schema::source::post::{Post, PostForm}; use lemmy_structs::blocking; use lemmy_utils::{ location_info, diff --git a/lemmy_apub/src/objects/user.rs b/lemmy_apub/src/objects/user.rs index 8c3312d1f..6862867a5 100644 --- a/lemmy_apub/src/objects/user.rs +++ b/lemmy_apub/src/objects/user.rs @@ -19,11 +19,11 @@ use activitystreams::{ use activitystreams_ext::Ext1; use anyhow::Context; use lemmy_db::{ - naive_now, source::user::{UserForm, User_}, ApubObject, DbPool, }; +use lemmy_db_schema::naive_now; use lemmy_structs::blocking; use lemmy_utils::{ location_info, diff --git a/lemmy_db/src/aggregates/community_aggregates.rs b/lemmy_db/src/aggregates/community_aggregates.rs index 47c40f7bc..cb94e6325 100644 --- a/lemmy_db/src/aggregates/community_aggregates.rs +++ b/lemmy_db/src/aggregates/community_aggregates.rs @@ -25,9 +25,7 @@ mod tests { use crate::{ aggregates::community_aggregates::CommunityAggregates, source::{ - comment::{Comment, CommentForm}, community::{Community, CommunityFollower, CommunityFollowerForm, CommunityForm}, - post::{Post, PostForm}, user::{UserForm, User_}, }, tests::establish_unpooled_connection, @@ -36,6 +34,10 @@ mod tests { ListingType, SortType, }; + use lemmy_db_schema::source::{ + comment::{Comment, CommentForm}, + post::{Post, PostForm}, + }; #[test] fn test_crud() { diff --git a/lemmy_db/src/aggregates/post_aggregates.rs b/lemmy_db/src/aggregates/post_aggregates.rs index 6cb3a7406..0b9bfa5fa 100644 --- a/lemmy_db/src/aggregates/post_aggregates.rs +++ b/lemmy_db/src/aggregates/post_aggregates.rs @@ -27,9 +27,7 @@ mod tests { use crate::{ aggregates::post_aggregates::PostAggregates, source::{ - comment::{Comment, CommentForm}, community::{Community, CommunityForm}, - post::{Post, PostForm, PostLike, PostLikeForm}, user::{UserForm, User_}, }, tests::establish_unpooled_connection, @@ -38,6 +36,10 @@ mod tests { ListingType, SortType, }; + use lemmy_db_schema::source::{ + comment::{Comment, CommentForm}, + post::{Post, PostForm, PostLike, PostLikeForm}, + }; #[test] fn test_crud() { diff --git a/lemmy_db/src/aggregates/site_aggregates.rs b/lemmy_db/src/aggregates/site_aggregates.rs index a3bd199c1..ea58b2166 100644 --- a/lemmy_db/src/aggregates/site_aggregates.rs +++ b/lemmy_db/src/aggregates/site_aggregates.rs @@ -23,9 +23,7 @@ mod tests { use crate::{ aggregates::site_aggregates::SiteAggregates, source::{ - comment::{Comment, CommentForm}, community::{Community, CommunityForm}, - post::{Post, PostForm}, user::{UserForm, User_}, }, tests::establish_unpooled_connection, @@ -33,6 +31,10 @@ mod tests { ListingType, SortType, }; + use lemmy_db_schema::source::{ + comment::{Comment, CommentForm}, + post::{Post, PostForm}, + }; #[test] fn test_crud() { diff --git a/lemmy_db/src/aggregates/user_aggregates.rs b/lemmy_db/src/aggregates/user_aggregates.rs index f6eab4679..91fa7460d 100644 --- a/lemmy_db/src/aggregates/user_aggregates.rs +++ b/lemmy_db/src/aggregates/user_aggregates.rs @@ -26,9 +26,7 @@ mod tests { use crate::{ aggregates::user_aggregates::UserAggregates, source::{ - comment::{Comment, CommentForm, CommentLike, CommentLikeForm}, community::{Community, CommunityForm}, - post::{Post, PostForm, PostLike, PostLikeForm}, user::{UserForm, User_}, }, tests::establish_unpooled_connection, @@ -37,6 +35,10 @@ mod tests { ListingType, SortType, }; + use lemmy_db_schema::source::{ + comment::{Comment, CommentForm, CommentLike, CommentLikeForm}, + post::{Post, PostForm, PostLike, PostLikeForm}, + }; #[test] fn test_crud() { diff --git a/lemmy_db/src/lib.rs b/lemmy_db/src/lib.rs index 52180fb72..9afb76191 100644 --- a/lemmy_db/src/lib.rs +++ b/lemmy_db/src/lib.rs @@ -5,7 +5,6 @@ extern crate strum_macros; #[macro_use] extern crate lazy_static; -use chrono::NaiveDateTime; use diesel::{result::Error, *}; use regex::Regex; use serde::{Deserialize, Serialize}; @@ -181,10 +180,6 @@ pub fn limit_and_offset(page: Option, limit: Option) -> (i64, i64) { (limit, offset) } -pub fn naive_now() -> NaiveDateTime { - chrono::prelude::Utc::now().naive_utc() -} - pub fn is_email_regex(test: &str) -> bool { EMAIL_REGEX.is_match(test) } diff --git a/lemmy_db/src/source/comment.rs b/lemmy_db/src/source/comment.rs index 76cd9133d..17e9d637a 100644 --- a/lemmy_db/src/source/comment.rs +++ b/lemmy_db/src/source/comment.rs @@ -1,74 +1,13 @@ -use super::post::Post; -use crate::{naive_now, ApubObject, Crud, Likeable, Saveable}; +use crate::{ApubObject, Crud, Likeable, Saveable}; use diesel::{dsl::*, result::Error, *}; -use lemmy_db_schema::schema::{comment, comment_alias_1, comment_like, comment_saved}; -use serde::Serialize; -use url::{ParseError, Url}; - -// WITH RECURSIVE MyTree AS ( -// SELECT * FROM comment WHERE parent_id IS NULL -// UNION ALL -// SELECT m.* FROM comment AS m JOIN MyTree AS t ON m.parent_id = t.id -// ) -// SELECT * FROM MyTree; - -#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)] -#[belongs_to(Post)] -#[table_name = "comment"] -pub struct Comment { - pub id: i32, - pub creator_id: i32, - pub post_id: i32, - pub parent_id: Option, - pub content: String, - pub removed: bool, - pub read: bool, // Whether the recipient has read the comment or not - pub published: chrono::NaiveDateTime, - pub updated: Option, - pub deleted: bool, - pub ap_id: String, - pub local: bool, -} - -#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)] -#[belongs_to(Post)] -#[table_name = "comment_alias_1"] -pub struct CommentAlias1 { - pub id: i32, - pub creator_id: i32, - pub post_id: i32, - pub parent_id: Option, - pub content: String, - pub removed: bool, - pub read: bool, // Whether the recipient has read the comment or not - pub published: chrono::NaiveDateTime, - pub updated: Option, - pub deleted: bool, - pub ap_id: String, - pub local: bool, -} - -#[derive(Insertable, AsChangeset, Clone)] -#[table_name = "comment"] -pub struct CommentForm { - pub creator_id: i32, - pub post_id: i32, - pub parent_id: Option, - pub content: String, - pub removed: Option, - pub read: Option, - pub published: Option, - pub updated: Option, - pub deleted: Option, - pub ap_id: Option, - pub local: bool, -} - -impl CommentForm { - pub fn get_ap_id(&self) -> Result { - Url::parse(&self.ap_id.as_ref().unwrap_or(&"not_a_url".to_string())) - } -} +use lemmy_db_schema::source::comment::{ + Comment, + CommentForm, + CommentLike, + CommentLikeForm, + CommentSaved, + CommentSavedForm, +}; impl Crud for Comment { fn read(conn: &PgConnection, comment_id: i32) -> Result { @@ -117,106 +56,6 @@ impl ApubObject for Comment { } } -impl Comment { - pub fn update_ap_id( - conn: &PgConnection, - comment_id: i32, - apub_id: String, - ) -> Result { - use lemmy_db_schema::schema::comment::dsl::*; - - diesel::update(comment.find(comment_id)) - .set(ap_id.eq(apub_id)) - .get_result::(conn) - } - - pub fn permadelete_for_creator( - conn: &PgConnection, - for_creator_id: i32, - ) -> Result, Error> { - use lemmy_db_schema::schema::comment::dsl::*; - diesel::update(comment.filter(creator_id.eq(for_creator_id))) - .set(( - content.eq("*Permananently Deleted*"), - deleted.eq(true), - updated.eq(naive_now()), - )) - .get_results::(conn) - } - - pub fn update_deleted( - conn: &PgConnection, - comment_id: i32, - new_deleted: bool, - ) -> Result { - use lemmy_db_schema::schema::comment::dsl::*; - diesel::update(comment.find(comment_id)) - .set((deleted.eq(new_deleted), updated.eq(naive_now()))) - .get_result::(conn) - } - - pub fn update_removed( - conn: &PgConnection, - comment_id: i32, - new_removed: bool, - ) -> Result { - use lemmy_db_schema::schema::comment::dsl::*; - diesel::update(comment.find(comment_id)) - .set((removed.eq(new_removed), updated.eq(naive_now()))) - .get_result::(conn) - } - - pub fn update_removed_for_creator( - conn: &PgConnection, - for_creator_id: i32, - new_removed: bool, - ) -> Result, Error> { - use lemmy_db_schema::schema::comment::dsl::*; - diesel::update(comment.filter(creator_id.eq(for_creator_id))) - .set((removed.eq(new_removed), updated.eq(naive_now()))) - .get_results::(conn) - } - - pub fn update_read(conn: &PgConnection, comment_id: i32, new_read: bool) -> Result { - use lemmy_db_schema::schema::comment::dsl::*; - diesel::update(comment.find(comment_id)) - .set(read.eq(new_read)) - .get_result::(conn) - } - - pub fn update_content( - conn: &PgConnection, - comment_id: i32, - new_content: &str, - ) -> Result { - use lemmy_db_schema::schema::comment::dsl::*; - diesel::update(comment.find(comment_id)) - .set((content.eq(new_content), updated.eq(naive_now()))) - .get_result::(conn) - } -} - -#[derive(Identifiable, Queryable, Associations, PartialEq, Debug, Clone)] -#[belongs_to(Comment)] -#[table_name = "comment_like"] -pub struct CommentLike { - pub id: i32, - pub user_id: i32, - pub comment_id: i32, - pub post_id: i32, // TODO this is redundant - pub score: i16, - pub published: chrono::NaiveDateTime, -} - -#[derive(Insertable, AsChangeset, Clone)] -#[table_name = "comment_like"] -pub struct CommentLikeForm { - pub user_id: i32, - pub comment_id: i32, - pub post_id: i32, // TODO this is redundant - pub score: i16, -} - impl Likeable for CommentLike { fn like(conn: &PgConnection, comment_like_form: &CommentLikeForm) -> Result { use lemmy_db_schema::schema::comment_like::dsl::*; @@ -238,23 +77,6 @@ impl Likeable for CommentLike { } } -#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] -#[belongs_to(Comment)] -#[table_name = "comment_saved"] -pub struct CommentSaved { - pub id: i32, - pub comment_id: i32, - pub user_id: i32, - pub published: chrono::NaiveDateTime, -} - -#[derive(Insertable, AsChangeset)] -#[table_name = "comment_saved"] -pub struct CommentSavedForm { - pub comment_id: i32, - pub user_id: i32, -} - impl Saveable for CommentSaved { fn save(conn: &PgConnection, comment_saved_form: &CommentSavedForm) -> Result { use lemmy_db_schema::schema::comment_saved::dsl::*; @@ -279,12 +101,15 @@ impl Saveable for CommentSaved { #[cfg(test)] mod tests { use crate::{ - source::{comment::*, community::*, post::*, user::*}, + source::{community::*, user::*}, tests::establish_unpooled_connection, Crud, + Likeable, ListingType, + Saveable, SortType, }; + use lemmy_db_schema::source::{comment::*, post::*}; #[test] fn test_crud() { diff --git a/lemmy_db/src/source/comment_report.rs b/lemmy_db/src/source/comment_report.rs index 2937e6315..d05d9e039 100644 --- a/lemmy_db/src/source/comment_report.rs +++ b/lemmy_db/src/source/comment_report.rs @@ -1,6 +1,6 @@ -use crate::{naive_now, source::comment::Comment, Reportable}; +use crate::Reportable; use diesel::{dsl::*, result::Error, *}; -use lemmy_db_schema::schema::comment_report; +use lemmy_db_schema::{naive_now, schema::comment_report, source::comment::Comment}; use serde::{Deserialize, Serialize}; #[derive(Identifiable, Queryable, Associations, PartialEq, Serialize, Deserialize, Debug, Clone)] diff --git a/lemmy_db/src/source/community.rs b/lemmy_db/src/source/community.rs index 05bc3c5c7..13045cca7 100644 --- a/lemmy_db/src/source/community.rs +++ b/lemmy_db/src/source/community.rs @@ -1,5 +1,4 @@ use crate::{ - naive_now, views::{community::community_moderator_view::CommunityModeratorView, user_view::UserViewSafe}, ApubObject, Bannable, @@ -8,11 +7,9 @@ use crate::{ Joinable, }; use diesel::{dsl::*, result::Error, *}; -use lemmy_db_schema::schema::{ - community, - community_follower, - community_moderator, - community_user_ban, +use lemmy_db_schema::{ + naive_now, + schema::{community, community_follower, community_moderator, community_user_ban}, }; use serde::Serialize; diff --git a/lemmy_db/src/source/moderator.rs b/lemmy_db/src/source/moderator.rs index 0766f49cd..eb6c2d566 100644 --- a/lemmy_db/src/source/moderator.rs +++ b/lemmy_db/src/source/moderator.rs @@ -391,11 +391,12 @@ impl Crud for ModAdd { #[cfg(test)] mod tests { use crate::{ - source::{comment::*, community::*, moderator::*, post::*, user::*}, + source::{community::*, moderator::*, user::*}, tests::establish_unpooled_connection, ListingType, SortType, }; + use lemmy_db_schema::source::{comment::*, post::*}; // use Crud; #[test] diff --git a/lemmy_db/src/source/post.rs b/lemmy_db/src/source/post.rs index 181157a21..5e8dc1cce 100644 --- a/lemmy_db/src/source/post.rs +++ b/lemmy_db/src/source/post.rs @@ -1,61 +1,15 @@ -use crate::{naive_now, ApubObject, Crud, Likeable, Readable, Saveable}; +use crate::{ApubObject, Crud, Likeable, Readable, Saveable}; use diesel::{dsl::*, result::Error, *}; -use lemmy_db_schema::schema::{post, post_like, post_read, post_saved}; -use serde::Serialize; -use url::{ParseError, Url}; - -#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] -#[table_name = "post"] -pub struct Post { - pub id: i32, - pub name: String, - pub url: Option, - pub body: Option, - pub creator_id: i32, - pub community_id: i32, - pub removed: bool, - pub locked: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, - pub deleted: bool, - pub nsfw: bool, - pub stickied: bool, - pub embed_title: Option, - pub embed_description: Option, - pub embed_html: Option, - pub thumbnail_url: Option, - pub ap_id: String, - pub local: bool, -} - -#[derive(Insertable, AsChangeset)] -#[table_name = "post"] -pub struct PostForm { - pub name: String, - pub url: Option, - pub body: Option, - pub creator_id: i32, - pub community_id: i32, - pub removed: Option, - pub locked: Option, - pub published: Option, - pub updated: Option, - pub deleted: Option, - pub nsfw: bool, - pub stickied: Option, - pub embed_title: Option, - pub embed_description: Option, - pub embed_html: Option, - pub thumbnail_url: Option, - pub ap_id: Option, - pub local: bool, -} - -impl PostForm { - pub fn get_ap_id(&self) -> Result { - Url::parse(&self.ap_id.as_ref().unwrap_or(&"not_a_url".to_string())) - } -} +use lemmy_db_schema::source::post::{ + Post, + PostForm, + PostLike, + PostLikeForm, + PostRead, + PostReadForm, + PostSaved, + PostSavedForm, +}; impl Crud for Post { fn read(conn: &PgConnection, post_id: i32) -> Result { @@ -98,137 +52,6 @@ impl ApubObject for Post { } } -impl Post { - pub fn read(conn: &PgConnection, post_id: i32) -> Result { - use lemmy_db_schema::schema::post::dsl::*; - post.filter(id.eq(post_id)).first::(conn) - } - - pub fn list_for_community( - conn: &PgConnection, - the_community_id: i32, - ) -> Result, Error> { - use lemmy_db_schema::schema::post::dsl::*; - post - .filter(community_id.eq(the_community_id)) - .then_order_by(published.desc()) - .then_order_by(stickied.desc()) - .limit(20) - .load::(conn) - } - - pub fn update_ap_id(conn: &PgConnection, post_id: i32, apub_id: String) -> Result { - use lemmy_db_schema::schema::post::dsl::*; - - diesel::update(post.find(post_id)) - .set(ap_id.eq(apub_id)) - .get_result::(conn) - } - - pub fn permadelete_for_creator( - conn: &PgConnection, - for_creator_id: i32, - ) -> Result, Error> { - use lemmy_db_schema::schema::post::dsl::*; - - let perma_deleted = "*Permananently Deleted*"; - let perma_deleted_url = "https://deleted.com"; - - diesel::update(post.filter(creator_id.eq(for_creator_id))) - .set(( - name.eq(perma_deleted), - url.eq(perma_deleted_url), - body.eq(perma_deleted), - deleted.eq(true), - updated.eq(naive_now()), - )) - .get_results::(conn) - } - - pub fn update_deleted( - conn: &PgConnection, - post_id: i32, - new_deleted: bool, - ) -> Result { - use lemmy_db_schema::schema::post::dsl::*; - diesel::update(post.find(post_id)) - .set((deleted.eq(new_deleted), updated.eq(naive_now()))) - .get_result::(conn) - } - - pub fn update_removed( - conn: &PgConnection, - post_id: i32, - new_removed: bool, - ) -> Result { - use lemmy_db_schema::schema::post::dsl::*; - diesel::update(post.find(post_id)) - .set((removed.eq(new_removed), updated.eq(naive_now()))) - .get_result::(conn) - } - - pub fn update_removed_for_creator( - conn: &PgConnection, - for_creator_id: i32, - for_community_id: Option, - new_removed: bool, - ) -> Result, Error> { - use lemmy_db_schema::schema::post::dsl::*; - - let mut update = diesel::update(post).into_boxed(); - update = update.filter(creator_id.eq(for_creator_id)); - - if let Some(for_community_id) = for_community_id { - update = update.filter(community_id.eq(for_community_id)); - } - - update - .set((removed.eq(new_removed), updated.eq(naive_now()))) - .get_results::(conn) - } - - pub fn update_locked(conn: &PgConnection, post_id: i32, new_locked: bool) -> Result { - use lemmy_db_schema::schema::post::dsl::*; - diesel::update(post.find(post_id)) - .set(locked.eq(new_locked)) - .get_result::(conn) - } - - pub fn update_stickied( - conn: &PgConnection, - post_id: i32, - new_stickied: bool, - ) -> Result { - use lemmy_db_schema::schema::post::dsl::*; - diesel::update(post.find(post_id)) - .set(stickied.eq(new_stickied)) - .get_result::(conn) - } - - pub fn is_post_creator(user_id: i32, post_creator_id: i32) -> bool { - user_id == post_creator_id - } -} - -#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] -#[belongs_to(Post)] -#[table_name = "post_like"] -pub struct PostLike { - pub id: i32, - pub post_id: i32, - pub user_id: i32, - pub score: i16, - pub published: chrono::NaiveDateTime, -} - -#[derive(Insertable, AsChangeset, Clone)] -#[table_name = "post_like"] -pub struct PostLikeForm { - pub post_id: i32, - pub user_id: i32, - pub score: i16, -} - impl Likeable for PostLike { fn like(conn: &PgConnection, post_like_form: &PostLikeForm) -> Result { use lemmy_db_schema::schema::post_like::dsl::*; @@ -250,23 +73,6 @@ impl Likeable for PostLike { } } -#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] -#[belongs_to(Post)] -#[table_name = "post_saved"] -pub struct PostSaved { - pub id: i32, - pub post_id: i32, - pub user_id: i32, - pub published: chrono::NaiveDateTime, -} - -#[derive(Insertable, AsChangeset)] -#[table_name = "post_saved"] -pub struct PostSavedForm { - pub post_id: i32, - pub user_id: i32, -} - impl Saveable for PostSaved { fn save(conn: &PgConnection, post_saved_form: &PostSavedForm) -> Result { use lemmy_db_schema::schema::post_saved::dsl::*; @@ -288,27 +94,6 @@ impl Saveable for PostSaved { } } -#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] -#[belongs_to(Post)] -#[table_name = "post_read"] -pub struct PostRead { - pub id: i32, - - pub post_id: i32, - - pub user_id: i32, - - pub published: chrono::NaiveDateTime, -} - -#[derive(Insertable, AsChangeset)] -#[table_name = "post_read"] -pub struct PostReadForm { - pub post_id: i32, - - pub user_id: i32, -} - impl Readable for PostRead { fn mark_as_read(conn: &PgConnection, post_read_form: &PostReadForm) -> Result { use lemmy_db_schema::schema::post_read::dsl::*; diff --git a/lemmy_db/src/source/post_report.rs b/lemmy_db/src/source/post_report.rs index af45aa3d0..e72e32a85 100644 --- a/lemmy_db/src/source/post_report.rs +++ b/lemmy_db/src/source/post_report.rs @@ -1,6 +1,6 @@ -use crate::{naive_now, source::post::Post, Reportable}; +use crate::Reportable; use diesel::{dsl::*, result::Error, *}; -use lemmy_db_schema::schema::post_report; +use lemmy_db_schema::{naive_now, schema::post_report, source::post::Post}; use serde::{Deserialize, Serialize}; #[derive(Identifiable, Queryable, Associations, PartialEq, Serialize, Deserialize, Debug, Clone)] diff --git a/lemmy_db/src/source/private_message.rs b/lemmy_db/src/source/private_message.rs index e2b55c879..fd73a8646 100644 --- a/lemmy_db/src/source/private_message.rs +++ b/lemmy_db/src/source/private_message.rs @@ -1,6 +1,6 @@ -use crate::{naive_now, ApubObject, Crud}; +use crate::{ApubObject, Crud}; use diesel::{dsl::*, result::Error, *}; -use lemmy_db_schema::schema::private_message; +use lemmy_db_schema::{naive_now, schema::private_message}; use serde::Serialize; #[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)] diff --git a/lemmy_db/src/source/site.rs b/lemmy_db/src/source/site.rs index ad6f9ea6f..a7db2ceea 100644 --- a/lemmy_db/src/source/site.rs +++ b/lemmy_db/src/source/site.rs @@ -1,6 +1,6 @@ -use crate::{naive_now, Crud}; +use crate::Crud; use diesel::{dsl::*, result::Error, *}; -use lemmy_db_schema::schema::site; +use lemmy_db_schema::{naive_now, schema::site}; use serde::Serialize; #[derive(Queryable, Identifiable, PartialEq, Debug, Clone, Serialize)] diff --git a/lemmy_db/src/source/user.rs b/lemmy_db/src/source/user.rs index 809a579af..6bca769e8 100644 --- a/lemmy_db/src/source/user.rs +++ b/lemmy_db/src/source/user.rs @@ -1,7 +1,10 @@ -use crate::{is_email_regex, naive_now, ApubObject, Crud}; +use crate::{is_email_regex, ApubObject, Crud}; use bcrypt::{hash, DEFAULT_COST}; use diesel::{dsl::*, result::Error, *}; -use lemmy_db_schema::schema::{user_, user_::dsl::*, user_alias_1, user_alias_2}; +use lemmy_db_schema::{ + naive_now, + schema::{user_, user_::dsl::*, user_alias_1, user_alias_2}, +}; use lemmy_utils::settings::Settings; use serde::Serialize; diff --git a/lemmy_db/src/source/user_mention.rs b/lemmy_db/src/source/user_mention.rs index a61d08d2c..5df172864 100644 --- a/lemmy_db/src/source/user_mention.rs +++ b/lemmy_db/src/source/user_mention.rs @@ -1,7 +1,6 @@ -use super::comment::Comment; use crate::Crud; use diesel::{dsl::*, result::Error, *}; -use lemmy_db_schema::schema::user_mention; +use lemmy_db_schema::{schema::user_mention, source::comment::Comment}; use serde::Serialize; #[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)] @@ -80,11 +79,12 @@ impl UserMention { #[cfg(test)] mod tests { use crate::{ - source::{comment::*, community::*, post::*, user::*, user_mention::*}, + source::{community::*, user::*, user_mention::*}, tests::establish_unpooled_connection, ListingType, SortType, }; + use lemmy_db_schema::source::{comment::*, post::*}; #[test] fn test_crud() { diff --git a/lemmy_db/src/views/comment_report_view.rs b/lemmy_db/src/views/comment_report_view.rs index 0f55b4320..b067a9ec1 100644 --- a/lemmy_db/src/views/comment_report_view.rs +++ b/lemmy_db/src/views/comment_report_view.rs @@ -1,10 +1,8 @@ use crate::{ limit_and_offset, source::{ - comment::Comment, comment_report::CommentReport, community::{Community, CommunitySafe}, - post::Post, user::{UserAlias1, UserAlias2, UserSafe, UserSafeAlias1, UserSafeAlias2, User_}, }, views::ViewToVec, @@ -12,14 +10,9 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{ - comment, - comment_report, - community, - post, - user_, - user_alias_1, - user_alias_2, +use lemmy_db_schema::{ + schema::{comment, comment_report, community, post, user_, user_alias_1, user_alias_2}, + source::{comment::Comment, post::Post}, }; use serde::Serialize; diff --git a/lemmy_db/src/views/comment_view.rs b/lemmy_db/src/views/comment_view.rs index 7f78c20f8..d4680a341 100644 --- a/lemmy_db/src/views/comment_view.rs +++ b/lemmy_db/src/views/comment_view.rs @@ -4,9 +4,7 @@ use crate::{ fuzzy_search, limit_and_offset, source::{ - comment::{Comment, CommentAlias1, CommentSaved}, community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, - post::Post, user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, }, views::ViewToVec, @@ -16,18 +14,24 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{ - comment, - comment_aggregates, - comment_alias_1, - comment_like, - comment_saved, - community, - community_follower, - community_user_ban, - post, - user_, - user_alias_1, +use lemmy_db_schema::{ + schema::{ + comment, + comment_aggregates, + comment_alias_1, + comment_like, + comment_saved, + community, + community_follower, + community_user_ban, + post, + user_, + user_alias_1, + }, + source::{ + comment::{Comment, CommentAlias1, CommentSaved}, + post::Post, + }, }; use serde::Serialize; @@ -408,13 +412,14 @@ impl ViewToVec for CommentView { #[cfg(test)] mod tests { use crate::{ - source::{comment::*, community::*, post::*, user::*}, + source::{community::*, user::*}, tests::establish_unpooled_connection, views::comment_view::*, Crud, Likeable, *, }; + use lemmy_db_schema::source::{comment::*, post::*}; #[test] fn test_crud() { diff --git a/lemmy_db/src/views/moderator/mod_lock_post_view.rs b/lemmy_db/src/views/moderator/mod_lock_post_view.rs index 2d71a8819..685d83bbc 100644 --- a/lemmy_db/src/views/moderator/mod_lock_post_view.rs +++ b/lemmy_db/src/views/moderator/mod_lock_post_view.rs @@ -3,14 +3,16 @@ use crate::{ source::{ community::{Community, CommunitySafe}, moderator::ModLockPost, - post::Post, user::{UserSafe, User_}, }, views::ViewToVec, ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{community, mod_lock_post, post, user_}; +use lemmy_db_schema::{ + schema::{community, mod_lock_post, post, user_}, + source::post::Post, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_remove_comment_view.rs b/lemmy_db/src/views/moderator/mod_remove_comment_view.rs index 4fa82eed2..0c6519de0 100644 --- a/lemmy_db/src/views/moderator/mod_remove_comment_view.rs +++ b/lemmy_db/src/views/moderator/mod_remove_comment_view.rs @@ -1,17 +1,18 @@ use crate::{ limit_and_offset, source::{ - comment::Comment, community::{Community, CommunitySafe}, moderator::ModRemoveComment, - post::Post, user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, }, views::ViewToVec, ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{comment, community, mod_remove_comment, post, user_, user_alias_1}; +use lemmy_db_schema::{ + schema::{comment, community, mod_remove_comment, post, user_, user_alias_1}, + source::{comment::Comment, post::Post}, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_remove_post_view.rs b/lemmy_db/src/views/moderator/mod_remove_post_view.rs index d21e985cd..98aefd211 100644 --- a/lemmy_db/src/views/moderator/mod_remove_post_view.rs +++ b/lemmy_db/src/views/moderator/mod_remove_post_view.rs @@ -3,14 +3,16 @@ use crate::{ source::{ community::{Community, CommunitySafe}, moderator::ModRemovePost, - post::Post, user::{UserSafe, User_}, }, views::ViewToVec, ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{community, mod_remove_post, post, user_}; +use lemmy_db_schema::{ + schema::{community, mod_remove_post, post, user_}, + source::post::Post, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_sticky_post_view.rs b/lemmy_db/src/views/moderator/mod_sticky_post_view.rs index ec2771592..40672f8b1 100644 --- a/lemmy_db/src/views/moderator/mod_sticky_post_view.rs +++ b/lemmy_db/src/views/moderator/mod_sticky_post_view.rs @@ -3,14 +3,16 @@ use crate::{ source::{ community::{Community, CommunitySafe}, moderator::ModStickyPost, - post::Post, user::{UserSafe, User_}, }, views::ViewToVec, ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{community, mod_sticky_post, post, user_}; +use lemmy_db_schema::{ + schema::{community, mod_sticky_post, post, user_}, + source::post::Post, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/post_report_view.rs b/lemmy_db/src/views/post_report_view.rs index 75bfac954..5e1862399 100644 --- a/lemmy_db/src/views/post_report_view.rs +++ b/lemmy_db/src/views/post_report_view.rs @@ -2,7 +2,6 @@ use crate::{ limit_and_offset, source::{ community::{Community, CommunitySafe}, - post::Post, post_report::PostReport, user::{UserAlias1, UserAlias2, UserSafe, UserSafeAlias1, UserSafeAlias2, User_}, }, @@ -11,7 +10,10 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{community, post, post_report, user_, user_alias_1, user_alias_2}; +use lemmy_db_schema::{ + schema::{community, post, post_report, user_, user_alias_1, user_alias_2}, + source::post::Post, +}; use serde::Serialize; #[derive(Debug, PartialEq, Serialize, Clone)] diff --git a/lemmy_db/src/views/post_view.rs b/lemmy_db/src/views/post_view.rs index 25d86aa16..fb3fbbf3f 100644 --- a/lemmy_db/src/views/post_view.rs +++ b/lemmy_db/src/views/post_view.rs @@ -5,7 +5,6 @@ use crate::{ limit_and_offset, source::{ community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, - post::{Post, PostRead, PostSaved}, user::{UserSafe, User_}, }, views::ViewToVec, @@ -15,16 +14,19 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{ - community, - community_follower, - community_user_ban, - post, - post_aggregates, - post_like, - post_read, - post_saved, - user_, +use lemmy_db_schema::{ + schema::{ + community, + community_follower, + community_user_ban, + post, + post_aggregates, + post_like, + post_read, + post_saved, + user_, + }, + source::post::{Post, PostRead, PostSaved}, }; use serde::Serialize; @@ -406,13 +408,14 @@ impl ViewToVec for PostView { mod tests { use crate::{ aggregates::post_aggregates::PostAggregates, - source::{community::*, post::*, user::*}, + source::{community::*, user::*}, tests::establish_unpooled_connection, views::post_view::{PostQueryBuilder, PostView}, Crud, Likeable, *, }; + use lemmy_db_schema::source::post::*; #[test] fn test_crud() { diff --git a/lemmy_db/src/views/user_mention_view.rs b/lemmy_db/src/views/user_mention_view.rs index bb5fa0093..61fb56260 100644 --- a/lemmy_db/src/views/user_mention_view.rs +++ b/lemmy_db/src/views/user_mention_view.rs @@ -3,9 +3,7 @@ use crate::{ functions::hot_rank, limit_and_offset, source::{ - comment::{Comment, CommentSaved}, community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, - post::Post, user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, user_mention::UserMention, }, @@ -15,18 +13,24 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{ - comment, - comment_aggregates, - comment_like, - comment_saved, - community, - community_follower, - community_user_ban, - post, - user_, - user_alias_1, - user_mention, +use lemmy_db_schema::{ + schema::{ + comment, + comment_aggregates, + comment_like, + comment_saved, + community, + community_follower, + community_user_ban, + post, + user_, + user_alias_1, + user_mention, + }, + source::{ + comment::{Comment, CommentSaved}, + post::Post, + }, }; use serde::Serialize; diff --git a/lemmy_db_schema/Cargo.toml b/lemmy_db_schema/Cargo.toml index 3ef975505..99b7399b1 100644 --- a/lemmy_db_schema/Cargo.toml +++ b/lemmy_db_schema/Cargo.toml @@ -5,3 +5,8 @@ edition = "2018" [dependencies] diesel = { version = "1.4.5", features = ["postgres","chrono","r2d2","serde_json"] } +chrono = { version = "0.4.19", features = ["serde"] } +serde = { version = "1.0.118", features = ["derive"] } +serde_json = { version = "1.0.60", features = ["preserve_order"] } +log = "0.4.11" +url = { version = "2.2.0", features = ["serde"] } diff --git a/lemmy_db_schema/src/lib.rs b/lemmy_db_schema/src/lib.rs index b37d94611..11451d173 100644 --- a/lemmy_db_schema/src/lib.rs +++ b/lemmy_db_schema/src/lib.rs @@ -1,4 +1,11 @@ #[macro_use] extern crate diesel; +use chrono::NaiveDateTime; + pub mod schema; +pub mod source; + +pub fn naive_now() -> NaiveDateTime { + chrono::prelude::Utc::now().naive_utc() +} diff --git a/lemmy_db_schema/src/source/comment.rs b/lemmy_db_schema/src/source/comment.rs new file mode 100644 index 000000000..345776403 --- /dev/null +++ b/lemmy_db_schema/src/source/comment.rs @@ -0,0 +1,190 @@ +use crate::{ + naive_now, + schema::{comment, comment_alias_1, comment_like, comment_saved}, + source::post::Post, +}; +use diesel::{result::Error, PgConnection, *}; +use serde::Serialize; +use url::{ParseError, Url}; + +// WITH RECURSIVE MyTree AS ( +// SELECT * FROM comment WHERE parent_id IS NULL +// UNION ALL +// SELECT m.* FROM comment AS m JOIN MyTree AS t ON m.parent_id = t.id +// ) +// SELECT * FROM MyTree; + +#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)] +#[belongs_to(Post)] +#[table_name = "comment"] +pub struct Comment { + pub id: i32, + pub creator_id: i32, + pub post_id: i32, + pub parent_id: Option, + pub content: String, + pub removed: bool, + pub read: bool, // Whether the recipient has read the comment or not + pub published: chrono::NaiveDateTime, + pub updated: Option, + pub deleted: bool, + pub ap_id: String, + pub local: bool, +} + +#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)] +#[belongs_to(Post)] +#[table_name = "comment_alias_1"] +pub struct CommentAlias1 { + pub id: i32, + pub creator_id: i32, + pub post_id: i32, + pub parent_id: Option, + pub content: String, + pub removed: bool, + pub read: bool, // Whether the recipient has read the comment or not + pub published: chrono::NaiveDateTime, + pub updated: Option, + pub deleted: bool, + pub ap_id: String, + pub local: bool, +} + +#[derive(Insertable, AsChangeset, Clone)] +#[table_name = "comment"] +pub struct CommentForm { + pub creator_id: i32, + pub post_id: i32, + pub parent_id: Option, + pub content: String, + pub removed: Option, + pub read: Option, + pub published: Option, + pub updated: Option, + pub deleted: Option, + pub ap_id: Option, + pub local: bool, +} + +impl Comment { + pub fn update_ap_id( + conn: &PgConnection, + comment_id: i32, + apub_id: String, + ) -> Result { + use crate::schema::comment::dsl::*; + + diesel::update(comment.find(comment_id)) + .set(ap_id.eq(apub_id)) + .get_result::(conn) + } + + pub fn permadelete_for_creator( + conn: &PgConnection, + for_creator_id: i32, + ) -> Result, Error> { + use crate::schema::comment::dsl::*; + diesel::update(comment.filter(creator_id.eq(for_creator_id))) + .set(( + content.eq("*Permananently Deleted*"), + deleted.eq(true), + updated.eq(naive_now()), + )) + .get_results::(conn) + } + + pub fn update_deleted( + conn: &PgConnection, + comment_id: i32, + new_deleted: bool, + ) -> Result { + use crate::schema::comment::dsl::*; + diesel::update(comment.find(comment_id)) + .set((deleted.eq(new_deleted), updated.eq(naive_now()))) + .get_result::(conn) + } + + pub fn update_removed( + conn: &PgConnection, + comment_id: i32, + new_removed: bool, + ) -> Result { + use crate::schema::comment::dsl::*; + diesel::update(comment.find(comment_id)) + .set((removed.eq(new_removed), updated.eq(naive_now()))) + .get_result::(conn) + } + + pub fn update_removed_for_creator( + conn: &PgConnection, + for_creator_id: i32, + new_removed: bool, + ) -> Result, Error> { + use crate::schema::comment::dsl::*; + diesel::update(comment.filter(creator_id.eq(for_creator_id))) + .set((removed.eq(new_removed), updated.eq(naive_now()))) + .get_results::(conn) + } + + pub fn update_read(conn: &PgConnection, comment_id: i32, new_read: bool) -> Result { + use crate::schema::comment::dsl::*; + diesel::update(comment.find(comment_id)) + .set(read.eq(new_read)) + .get_result::(conn) + } + + pub fn update_content( + conn: &PgConnection, + comment_id: i32, + new_content: &str, + ) -> Result { + use crate::schema::comment::dsl::*; + diesel::update(comment.find(comment_id)) + .set((content.eq(new_content), updated.eq(naive_now()))) + .get_result::(conn) + } +} + +impl CommentForm { + pub fn get_ap_id(&self) -> Result { + Url::parse(&self.ap_id.as_ref().unwrap_or(&"not_a_url".to_string())) + } +} + +#[derive(Identifiable, Queryable, Associations, PartialEq, Debug, Clone)] +#[belongs_to(Comment)] +#[table_name = "comment_like"] +pub struct CommentLike { + pub id: i32, + pub user_id: i32, + pub comment_id: i32, + pub post_id: i32, // TODO this is redundant + pub score: i16, + pub published: chrono::NaiveDateTime, +} + +#[derive(Insertable, AsChangeset, Clone)] +#[table_name = "comment_like"] +pub struct CommentLikeForm { + pub user_id: i32, + pub comment_id: i32, + pub post_id: i32, // TODO this is redundant + pub score: i16, +} + +#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] +#[belongs_to(Comment)] +#[table_name = "comment_saved"] +pub struct CommentSaved { + pub id: i32, + pub comment_id: i32, + pub user_id: i32, + pub published: chrono::NaiveDateTime, +} + +#[derive(Insertable, AsChangeset)] +#[table_name = "comment_saved"] +pub struct CommentSavedForm { + pub comment_id: i32, + pub user_id: i32, +} diff --git a/lemmy_db_schema/src/source/mod.rs b/lemmy_db_schema/src/source/mod.rs new file mode 100644 index 000000000..38203b5eb --- /dev/null +++ b/lemmy_db_schema/src/source/mod.rs @@ -0,0 +1,2 @@ +pub mod comment; +pub mod post; diff --git a/lemmy_db_schema/src/source/post.rs b/lemmy_db_schema/src/source/post.rs new file mode 100644 index 000000000..a0b974e2d --- /dev/null +++ b/lemmy_db_schema/src/source/post.rs @@ -0,0 +1,229 @@ +use crate::{ + naive_now, + schema::{post, post_like, post_read, post_saved}, +}; +use diesel::{result::Error, *}; +use serde::Serialize; +use url::{ParseError, Url}; + +#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] +#[table_name = "post"] +pub struct Post { + pub id: i32, + pub name: String, + pub url: Option, + pub body: Option, + pub creator_id: i32, + pub community_id: i32, + pub removed: bool, + pub locked: bool, + pub published: chrono::NaiveDateTime, + pub updated: Option, + pub deleted: bool, + pub nsfw: bool, + pub stickied: bool, + pub embed_title: Option, + pub embed_description: Option, + pub embed_html: Option, + pub thumbnail_url: Option, + pub ap_id: String, + pub local: bool, +} + +#[derive(Insertable, AsChangeset)] +#[table_name = "post"] +pub struct PostForm { + pub name: String, + pub url: Option, + pub body: Option, + pub creator_id: i32, + pub community_id: i32, + pub removed: Option, + pub locked: Option, + pub published: Option, + pub updated: Option, + pub deleted: Option, + pub nsfw: bool, + pub stickied: Option, + pub embed_title: Option, + pub embed_description: Option, + pub embed_html: Option, + pub thumbnail_url: Option, + pub ap_id: Option, + pub local: bool, +} + +impl Post { + pub fn read(conn: &PgConnection, post_id: i32) -> Result { + use crate::schema::post::dsl::*; + post.filter(id.eq(post_id)).first::(conn) + } + + pub fn list_for_community( + conn: &PgConnection, + the_community_id: i32, + ) -> Result, Error> { + use crate::schema::post::dsl::*; + post + .filter(community_id.eq(the_community_id)) + .then_order_by(published.desc()) + .then_order_by(stickied.desc()) + .limit(20) + .load::(conn) + } + + pub fn update_ap_id(conn: &PgConnection, post_id: i32, apub_id: String) -> Result { + use crate::schema::post::dsl::*; + + diesel::update(post.find(post_id)) + .set(ap_id.eq(apub_id)) + .get_result::(conn) + } + + pub fn permadelete_for_creator( + conn: &PgConnection, + for_creator_id: i32, + ) -> Result, Error> { + use crate::schema::post::dsl::*; + + let perma_deleted = "*Permananently Deleted*"; + let perma_deleted_url = "https://deleted.com"; + + diesel::update(post.filter(creator_id.eq(for_creator_id))) + .set(( + name.eq(perma_deleted), + url.eq(perma_deleted_url), + body.eq(perma_deleted), + deleted.eq(true), + updated.eq(naive_now()), + )) + .get_results::(conn) + } + + pub fn update_deleted( + conn: &PgConnection, + post_id: i32, + new_deleted: bool, + ) -> Result { + use crate::schema::post::dsl::*; + diesel::update(post.find(post_id)) + .set((deleted.eq(new_deleted), updated.eq(naive_now()))) + .get_result::(conn) + } + + pub fn update_removed( + conn: &PgConnection, + post_id: i32, + new_removed: bool, + ) -> Result { + use crate::schema::post::dsl::*; + diesel::update(post.find(post_id)) + .set((removed.eq(new_removed), updated.eq(naive_now()))) + .get_result::(conn) + } + + pub fn update_removed_for_creator( + conn: &PgConnection, + for_creator_id: i32, + for_community_id: Option, + new_removed: bool, + ) -> Result, Error> { + use crate::schema::post::dsl::*; + + let mut update = diesel::update(post).into_boxed(); + update = update.filter(creator_id.eq(for_creator_id)); + + if let Some(for_community_id) = for_community_id { + update = update.filter(community_id.eq(for_community_id)); + } + + update + .set((removed.eq(new_removed), updated.eq(naive_now()))) + .get_results::(conn) + } + + pub fn update_locked(conn: &PgConnection, post_id: i32, new_locked: bool) -> Result { + use crate::schema::post::dsl::*; + diesel::update(post.find(post_id)) + .set(locked.eq(new_locked)) + .get_result::(conn) + } + + pub fn update_stickied( + conn: &PgConnection, + post_id: i32, + new_stickied: bool, + ) -> Result { + use crate::schema::post::dsl::*; + diesel::update(post.find(post_id)) + .set(stickied.eq(new_stickied)) + .get_result::(conn) + } + + pub fn is_post_creator(user_id: i32, post_creator_id: i32) -> bool { + user_id == post_creator_id + } +} + +impl PostForm { + pub fn get_ap_id(&self) -> Result { + Url::parse(&self.ap_id.as_ref().unwrap_or(&"not_a_url".to_string())) + } +} + +#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] +#[belongs_to(Post)] +#[table_name = "post_like"] +pub struct PostLike { + pub id: i32, + pub post_id: i32, + pub user_id: i32, + pub score: i16, + pub published: chrono::NaiveDateTime, +} + +#[derive(Insertable, AsChangeset, Clone)] +#[table_name = "post_like"] +pub struct PostLikeForm { + pub post_id: i32, + pub user_id: i32, + pub score: i16, +} + +#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] +#[belongs_to(Post)] +#[table_name = "post_saved"] +pub struct PostSaved { + pub id: i32, + pub post_id: i32, + pub user_id: i32, + pub published: chrono::NaiveDateTime, +} + +#[derive(Insertable, AsChangeset)] +#[table_name = "post_saved"] +pub struct PostSavedForm { + pub post_id: i32, + pub user_id: i32, +} + +#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] +#[belongs_to(Post)] +#[table_name = "post_read"] +pub struct PostRead { + pub id: i32, + + pub post_id: i32, + + pub user_id: i32, + + pub published: chrono::NaiveDateTime, +} + +#[derive(Insertable, AsChangeset)] +#[table_name = "post_read"] +pub struct PostReadForm { + pub post_id: i32, + + pub user_id: i32, +} diff --git a/lemmy_structs/Cargo.toml b/lemmy_structs/Cargo.toml index e14623064..329ef4139 100644 --- a/lemmy_structs/Cargo.toml +++ b/lemmy_structs/Cargo.toml @@ -10,6 +10,7 @@ path = "src/lib.rs" [dependencies] lemmy_db = { path = "../lemmy_db" } +lemmy_db_schema = { path = "../lemmy_db_schema" } lemmy_utils = { path = "../lemmy_utils" } serde = { version = "1.0.118", features = ["derive"] } log = "0.4.11" diff --git a/lemmy_structs/src/lib.rs b/lemmy_structs/src/lib.rs index dc06a40cd..595f6d074 100644 --- a/lemmy_structs/src/lib.rs +++ b/lemmy_structs/src/lib.rs @@ -8,14 +8,13 @@ pub mod websocket; use diesel::PgConnection; use lemmy_db::{ source::{ - comment::Comment, - post::Post, user::User_, user_mention::{UserMention, UserMentionForm}, }, Crud, DbPool, }; +use lemmy_db_schema::source::{comment::Comment, post::Post}; use lemmy_utils::{email::send_email, settings::Settings, utils::MentionData, LemmyError}; use log::error; use serde::{Deserialize, Serialize}; diff --git a/lemmy_websocket/Cargo.toml b/lemmy_websocket/Cargo.toml index ed0ba4ce0..30dbe1fbd 100644 --- a/lemmy_websocket/Cargo.toml +++ b/lemmy_websocket/Cargo.toml @@ -12,6 +12,7 @@ path = "src/lib.rs" lemmy_utils = { path = "../lemmy_utils" } lemmy_structs = { path = "../lemmy_structs" } lemmy_db = { path = "../lemmy_db" } +lemmy_db_schema = { path = "../lemmy_db_schema" } lemmy_rate_limit = { path = "../lemmy_rate_limit" } reqwest = { version = "0.10.10", features = ["json"] } log = "0.4.11" diff --git a/lemmy_websocket/src/handlers.rs b/lemmy_websocket/src/handlers.rs index d95dfd57f..0762b9485 100644 --- a/lemmy_websocket/src/handlers.rs +++ b/lemmy_websocket/src/handlers.rs @@ -3,7 +3,7 @@ use crate::{ messages::*, }; use actix::{Actor, Context, Handler, ResponseFuture}; -use lemmy_db::naive_now; +use lemmy_db_schema::naive_now; use log::{error, info}; use rand::Rng; use serde::Serialize; diff --git a/src/code_migrations.rs b/src/code_migrations.rs index 6a39d0dad..c294be67c 100644 --- a/src/code_migrations.rs +++ b/src/code_migrations.rs @@ -4,16 +4,17 @@ use diesel::{ *, }; use lemmy_db::{ - naive_now, source::{ - comment::Comment, community::{Community, CommunityForm}, - post::Post, private_message::PrivateMessage, user::{UserForm, User_}, }, Crud, }; +use lemmy_db_schema::{ + naive_now, + source::{comment::Comment, post::Post}, +}; use lemmy_utils::{ apub::{generate_actor_keypair, make_apub_endpoint, EndpointType}, settings::Settings, From f842bbff8dbdee00d85d8bd636d65eb98284310c Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 18 Dec 2020 19:38:32 +0100 Subject: [PATCH 3/6] Move user to lemmy_db_schema, create traits for impls --- lemmy_api/src/claims.rs | 2 +- lemmy_api/src/comment.rs | 3 +- lemmy_api/src/community.rs | 2 +- lemmy_api/src/lib.rs | 7 +- lemmy_api/src/post.rs | 1 + lemmy_api/src/user.rs | 6 +- lemmy_apub/src/activities/receive/comment.rs | 2 +- .../src/activities/receive/comment_undo.rs | 2 +- lemmy_apub/src/activities/receive/mod.rs | 2 +- lemmy_apub/src/activities/receive/post.rs | 2 +- .../src/activities/receive/post_undo.rs | 2 +- lemmy_apub/src/activities/send/comment.rs | 8 +- lemmy_apub/src/activities/send/post.rs | 7 +- .../src/activities/send/private_message.rs | 6 +- lemmy_apub/src/activities/send/user.rs | 6 +- lemmy_apub/src/activity_queue.rs | 6 +- lemmy_apub/src/fetcher.rs | 5 +- lemmy_apub/src/http/community.rs | 2 +- lemmy_apub/src/http/post.rs | 1 + lemmy_apub/src/http/user.rs | 3 +- lemmy_apub/src/inbox/community_inbox.rs | 6 +- lemmy_apub/src/inbox/mod.rs | 3 +- lemmy_apub/src/inbox/user_inbox.rs | 3 +- lemmy_apub/src/lib.rs | 6 +- lemmy_apub/src/objects/comment.rs | 7 +- lemmy_apub/src/objects/post.rs | 9 +- lemmy_apub/src/objects/private_message.rs | 6 +- lemmy_apub/src/objects/user.rs | 7 +- lemmy_db/Cargo.toml | 2 +- .../src/aggregates/community_aggregates.rs | 6 +- lemmy_db/src/aggregates/post_aggregates.rs | 6 +- lemmy_db/src/aggregates/site_aggregates.rs | 6 +- lemmy_db/src/aggregates/user_aggregates.rs | 6 +- lemmy_db/src/source/activity.rs | 6 +- lemmy_db/src/source/comment.rs | 126 ++++++++- lemmy_db/src/source/community.rs | 8 +- lemmy_db/src/source/moderator.rs | 4 +- lemmy_db/src/source/password_reset_request.rs | 2 +- lemmy_db/src/source/post.rs | 137 +++++++++- lemmy_db/src/source/private_message.rs | 3 +- lemmy_db/src/source/user.rs | 245 +++--------------- lemmy_db/src/source/user_mention.rs | 4 +- lemmy_db/src/views/comment_report_view.rs | 7 +- lemmy_db/src/views/comment_view.rs | 10 +- .../community/community_follower_view.rs | 10 +- .../community/community_moderator_view.rs | 10 +- .../community/community_user_ban_view.rs | 10 +- .../src/views/community/community_view.rs | 10 +- .../views/moderator/mod_add_community_view.rs | 6 +- lemmy_db/src/views/moderator/mod_add_view.rs | 15 +- .../moderator/mod_ban_from_community_view.rs | 6 +- lemmy_db/src/views/moderator/mod_ban_view.rs | 15 +- .../src/views/moderator/mod_lock_post_view.rs | 6 +- .../moderator/mod_remove_comment_view.rs | 7 +- .../moderator/mod_remove_community_view.rs | 6 +- .../views/moderator/mod_remove_post_view.rs | 6 +- .../views/moderator/mod_sticky_post_view.rs | 6 +- lemmy_db/src/views/post_report_view.rs | 6 +- lemmy_db/src/views/post_view.rs | 14 +- lemmy_db/src/views/private_message_view.rs | 10 +- lemmy_db/src/views/site_view.rs | 13 +- lemmy_db/src/views/user_mention_view.rs | 2 +- lemmy_db/src/views/user_view.rs | 6 +- lemmy_db_schema/src/lib.rs | 1 + lemmy_db_schema/src/source/comment.rs | 81 ------ lemmy_db_schema/src/source/mod.rs | 1 + lemmy_db_schema/src/source/post.rs | 118 +-------- lemmy_db_schema/src/source/user.rs | 182 +++++++++++++ lemmy_structs/src/lib.rs | 4 +- lemmy_structs/src/site.rs | 3 +- src/code_migrations.rs | 9 +- src/routes/feeds.rs | 3 +- src/routes/webfinger.rs | 3 +- tests/integration_test.rs | 6 +- 74 files changed, 651 insertions(+), 624 deletions(-) create mode 100644 lemmy_db_schema/src/source/user.rs diff --git a/lemmy_api/src/claims.rs b/lemmy_api/src/claims.rs index 4a0ab12b8..f99730bdd 100644 --- a/lemmy_api/src/claims.rs +++ b/lemmy_api/src/claims.rs @@ -1,5 +1,5 @@ use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, TokenData, Validation}; -use lemmy_db::source::user::User_; +use lemmy_db_schema::source::user::User_; use lemmy_utils::settings::Settings; use serde::{Deserialize, Serialize}; diff --git a/lemmy_api/src/comment.rs b/lemmy_api/src/comment.rs index acff60042..78c45c497 100644 --- a/lemmy_api/src/comment.rs +++ b/lemmy_api/src/comment.rs @@ -11,9 +11,9 @@ use actix_web::web::Data; use lemmy_apub::{ApubLikeableType, ApubObjectType}; use lemmy_db::{ source::{ + comment::Comment_, comment_report::{CommentReport, CommentReportForm}, moderator::*, - user::*, }, views::{ comment_report_view::{CommentReportQueryBuilder, CommentReportView}, @@ -30,6 +30,7 @@ use lemmy_db::{ use lemmy_db_schema::source::{ comment::{Comment, CommentForm, CommentLike, CommentLikeForm, CommentSaved, CommentSavedForm}, post::Post, + user::*, }; use lemmy_structs::{blocking, comment::*, send_local_notifs}; use lemmy_utils::{ diff --git a/lemmy_api/src/community.rs b/lemmy_api/src/community.rs index 35aafc88e..0316beaa3 100644 --- a/lemmy_api/src/community.rs +++ b/lemmy_api/src/community.rs @@ -11,7 +11,7 @@ use anyhow::Context; use lemmy_apub::ActorType; use lemmy_db::{ diesel_option_overwrite, - source::{community::*, moderator::*, site::*}, + source::{comment::Comment_, community::*, moderator::*, post::Post_, site::*}, views::{ comment_view::CommentQueryBuilder, community::{ diff --git a/lemmy_api/src/lib.rs b/lemmy_api/src/lib.rs index 927846c0a..e6c3b8253 100644 --- a/lemmy_api/src/lib.rs +++ b/lemmy_api/src/lib.rs @@ -1,15 +1,12 @@ use crate::claims::Claims; use actix_web::{web, web::Data}; use lemmy_db::{ - source::{ - community::{Community, CommunityModerator}, - user::User_, - }, + source::community::{Community, CommunityModerator}, views::community::community_user_ban_view::CommunityUserBanView, Crud, DbPool, }; -use lemmy_db_schema::source::post::Post; +use lemmy_db_schema::source::{post::Post, user::User_}; use lemmy_structs::{blocking, comment::*, community::*, post::*, site::*, user::*}; use lemmy_utils::{settings::Settings, APIError, ConnectionId, LemmyError}; use lemmy_websocket::{serialize_websocket_message, LemmyContext, UserOperation}; diff --git a/lemmy_api/src/post.rs b/lemmy_api/src/post.rs index ee09059a5..9024541c5 100644 --- a/lemmy_api/src/post.rs +++ b/lemmy_api/src/post.rs @@ -12,6 +12,7 @@ use lemmy_apub::{ApubLikeableType, ApubObjectType}; use lemmy_db::{ source::{ moderator::*, + post::Post_, post_report::{PostReport, PostReportForm}, }, views::{ diff --git a/lemmy_api/src/user.rs b/lemmy_api/src/user.rs index 680910b84..a6e1cbced 100644 --- a/lemmy_api/src/user.rs +++ b/lemmy_api/src/user.rs @@ -17,12 +17,14 @@ use lemmy_apub::ApubObjectType; use lemmy_db::{ diesel_option_overwrite, source::{ + comment::Comment_, community::*, moderator::*, password_reset_request::*, + post::Post_, private_message::*, site::*, - user::*, + user::User, user_mention::*, }, views::{ @@ -47,7 +49,7 @@ use lemmy_db::{ }; use lemmy_db_schema::{ naive_now, - source::{comment::Comment, post::Post}, + source::{comment::Comment, post::Post, user::*}, }; use lemmy_structs::{blocking, send_email_to_user, user::*}; use lemmy_utils::{ diff --git a/lemmy_apub/src/activities/receive/comment.rs b/lemmy_apub/src/activities/receive/comment.rs index 76337c4fd..0149e9313 100644 --- a/lemmy_apub/src/activities/receive/comment.rs +++ b/lemmy_apub/src/activities/receive/comment.rs @@ -4,7 +4,7 @@ use activitystreams::{ base::ExtendsExt, }; use anyhow::Context; -use lemmy_db::{views::comment_view::CommentView, Likeable}; +use lemmy_db::{source::comment::Comment_, views::comment_view::CommentView, Crud, Likeable}; use lemmy_db_schema::source::{ comment::{Comment, CommentLike, CommentLikeForm}, post::Post, diff --git a/lemmy_apub/src/activities/receive/comment_undo.rs b/lemmy_apub/src/activities/receive/comment_undo.rs index f446b2860..7e6720457 100644 --- a/lemmy_apub/src/activities/receive/comment_undo.rs +++ b/lemmy_apub/src/activities/receive/comment_undo.rs @@ -1,6 +1,6 @@ use crate::activities::receive::get_actor_as_user; use activitystreams::activity::{Dislike, Like}; -use lemmy_db::{views::comment_view::CommentView, Likeable}; +use lemmy_db::{source::comment::Comment_, views::comment_view::CommentView, Likeable}; use lemmy_db_schema::source::comment::{Comment, CommentLike}; use lemmy_structs::{blocking, comment::CommentResponse}; use lemmy_utils::LemmyError; diff --git a/lemmy_apub/src/activities/receive/mod.rs b/lemmy_apub/src/activities/receive/mod.rs index a66ddfb95..f52bbea1a 100644 --- a/lemmy_apub/src/activities/receive/mod.rs +++ b/lemmy_apub/src/activities/receive/mod.rs @@ -5,7 +5,7 @@ use activitystreams::{ error::DomainError, }; use anyhow::{anyhow, Context}; -use lemmy_db::source::user::User_; +use lemmy_db_schema::source::user::User_; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; use log::debug; diff --git a/lemmy_apub/src/activities/receive/post.rs b/lemmy_apub/src/activities/receive/post.rs index 4a3cc13f7..8e20da75f 100644 --- a/lemmy_apub/src/activities/receive/post.rs +++ b/lemmy_apub/src/activities/receive/post.rs @@ -4,7 +4,7 @@ use activitystreams::{ prelude::*, }; use anyhow::Context; -use lemmy_db::{views::post_view::PostView, Likeable}; +use lemmy_db::{source::post::Post_, views::post_view::PostView, Likeable}; use lemmy_db_schema::source::post::{Post, PostLike, PostLikeForm}; use lemmy_structs::{blocking, post::PostResponse}; use lemmy_utils::{location_info, LemmyError}; diff --git a/lemmy_apub/src/activities/receive/post_undo.rs b/lemmy_apub/src/activities/receive/post_undo.rs index 817a74e41..facaf65f1 100644 --- a/lemmy_apub/src/activities/receive/post_undo.rs +++ b/lemmy_apub/src/activities/receive/post_undo.rs @@ -1,6 +1,6 @@ use crate::activities::receive::get_actor_as_user; use activitystreams::activity::{Dislike, Like}; -use lemmy_db::{views::post_view::PostView, Likeable}; +use lemmy_db::{source::post::Post_, views::post_view::PostView, Likeable}; use lemmy_db_schema::source::post::{Post, PostLike}; use lemmy_structs::{blocking, post::PostResponse}; use lemmy_utils::LemmyError; diff --git a/lemmy_apub/src/activities/send/comment.rs b/lemmy_apub/src/activities/send/comment.rs index 358e5020a..fa39fd472 100644 --- a/lemmy_apub/src/activities/send/comment.rs +++ b/lemmy_apub/src/activities/send/comment.rs @@ -26,12 +26,8 @@ use activitystreams::{ }; use anyhow::anyhow; use itertools::Itertools; -use lemmy_db::{ - source::{community::Community, user::User_}, - Crud, - DbPool, -}; -use lemmy_db_schema::source::{comment::Comment, post::Post}; +use lemmy_db::{source::community::Community, Crud, DbPool}; +use lemmy_db_schema::source::{comment::Comment, post::Post, user::User_}; use lemmy_structs::{blocking, WebFingerResponse}; use lemmy_utils::{ request::{retry, RecvError}, diff --git a/lemmy_apub/src/activities/send/post.rs b/lemmy_apub/src/activities/send/post.rs index fd7f7c12a..c79f79ac5 100644 --- a/lemmy_apub/src/activities/send/post.rs +++ b/lemmy_apub/src/activities/send/post.rs @@ -21,11 +21,8 @@ use activitystreams::{ prelude::*, public, }; -use lemmy_db::{ - source::{community::Community, user::User_}, - Crud, -}; -use lemmy_db_schema::source::post::Post; +use lemmy_db::{source::community::Community, Crud}; +use lemmy_db_schema::source::{post::Post, user::User_}; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/activities/send/private_message.rs b/lemmy_apub/src/activities/send/private_message.rs index 9abe70d66..4c8cb8748 100644 --- a/lemmy_apub/src/activities/send/private_message.rs +++ b/lemmy_apub/src/activities/send/private_message.rs @@ -16,10 +16,8 @@ use activitystreams::{ }, prelude::*, }; -use lemmy_db::{ - source::{private_message::PrivateMessage, user::User_}, - Crud, -}; +use lemmy_db::{source::private_message::PrivateMessage, Crud}; +use lemmy_db_schema::source::user::User_; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/activities/send/user.rs b/lemmy_apub/src/activities/send/user.rs index 26c5a5d56..8c01aff85 100644 --- a/lemmy_apub/src/activities/send/user.rs +++ b/lemmy_apub/src/activities/send/user.rs @@ -14,14 +14,12 @@ use activitystreams::{ object::ObjectExt, }; use lemmy_db::{ - source::{ - community::{Community, CommunityFollower, CommunityFollowerForm}, - user::User_, - }, + source::community::{Community, CommunityFollower, CommunityFollowerForm}, ApubObject, DbPool, Followable, }; +use lemmy_db_schema::source::user::User_; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/activity_queue.rs b/lemmy_apub/src/activity_queue.rs index 07990457c..b32a3eb67 100644 --- a/lemmy_apub/src/activity_queue.rs +++ b/lemmy_apub/src/activity_queue.rs @@ -19,10 +19,8 @@ use background_jobs::{ WorkerConfig, }; use itertools::Itertools; -use lemmy_db::{ - source::{community::Community, user::User_}, - DbPool, -}; +use lemmy_db::{source::community::Community, DbPool}; +use lemmy_db_schema::source::user::User_; use lemmy_utils::{location_info, settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; use log::{debug, warn}; diff --git a/lemmy_apub/src/fetcher.rs b/lemmy_apub/src/fetcher.rs index d06b221e2..a4c5d66fc 100644 --- a/lemmy_apub/src/fetcher.rs +++ b/lemmy_apub/src/fetcher.rs @@ -15,7 +15,7 @@ use diesel::result::Error::NotFound; use lemmy_db::{ source::{ community::{Community, CommunityModerator, CommunityModeratorForm}, - user::User_, + user::User, }, views::{ comment_view::CommentView, @@ -24,12 +24,13 @@ use lemmy_db::{ user_view::UserViewSafe, }, ApubObject, + Crud, Joinable, SearchType, }; use lemmy_db_schema::{ naive_now, - source::{comment::Comment, post::Post}, + source::{comment::Comment, post::Post, user::User_}, }; use lemmy_structs::{blocking, site::SearchResponse}; use lemmy_utils::{ diff --git a/lemmy_apub/src/http/community.rs b/lemmy_apub/src/http/community.rs index a1a7870f0..0ab14e070 100644 --- a/lemmy_apub/src/http/community.rs +++ b/lemmy_apub/src/http/community.rs @@ -10,7 +10,7 @@ use activitystreams::{ }; use actix_web::{body::Body, web, HttpResponse}; use lemmy_db::{ - source::community::Community, + source::{community::Community, post::Post_}, views::community::community_follower_view::CommunityFollowerView, }; use lemmy_db_schema::source::post::Post; diff --git a/lemmy_apub/src/http/post.rs b/lemmy_apub/src/http/post.rs index ad8464076..8ade35296 100644 --- a/lemmy_apub/src/http/post.rs +++ b/lemmy_apub/src/http/post.rs @@ -4,6 +4,7 @@ use crate::{ }; use actix_web::{body::Body, web, HttpResponse}; use diesel::result::Error::NotFound; +use lemmy_db::Crud; use lemmy_db_schema::source::post::Post; use lemmy_structs::blocking; use lemmy_utils::LemmyError; diff --git a/lemmy_apub/src/http/user.rs b/lemmy_apub/src/http/user.rs index 8dcc8edab..b01347e0d 100644 --- a/lemmy_apub/src/http/user.rs +++ b/lemmy_apub/src/http/user.rs @@ -9,7 +9,8 @@ use activitystreams::{ collection::{CollectionExt, OrderedCollection}, }; use actix_web::{body::Body, web, HttpResponse}; -use lemmy_db::source::user::User_; +use lemmy_db::source::user::User; +use lemmy_db_schema::source::user::User_; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/inbox/community_inbox.rs b/lemmy_apub/src/inbox/community_inbox.rs index a2bed621c..9d5d4d1b7 100644 --- a/lemmy_apub/src/inbox/community_inbox.rs +++ b/lemmy_apub/src/inbox/community_inbox.rs @@ -27,15 +27,13 @@ use activitystreams::{ use actix_web::{web, HttpRequest, HttpResponse}; use anyhow::{anyhow, Context}; use lemmy_db::{ - source::{ - community::{Community, CommunityFollower, CommunityFollowerForm}, - user::User_, - }, + source::community::{Community, CommunityFollower, CommunityFollowerForm}, views::community::community_user_ban_view::CommunityUserBanView, ApubObject, DbPool, Followable, }; +use lemmy_db_schema::source::user::User_; use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/inbox/mod.rs b/lemmy_apub/src/inbox/mod.rs index 415851883..2d0977724 100644 --- a/lemmy_apub/src/inbox/mod.rs +++ b/lemmy_apub/src/inbox/mod.rs @@ -13,10 +13,11 @@ use activitystreams::{ use actix_web::HttpRequest; use anyhow::{anyhow, Context}; use lemmy_db::{ - source::{activity::Activity, community::Community, user::User_}, + source::{activity::Activity, community::Community}, ApubObject, DbPool, }; +use lemmy_db_schema::source::user::User_; use lemmy_structs::blocking; use lemmy_utils::{location_info, settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/inbox/user_inbox.rs b/lemmy_apub/src/inbox/user_inbox.rs index 374772d6d..d9feffd38 100644 --- a/lemmy_apub/src/inbox/user_inbox.rs +++ b/lemmy_apub/src/inbox/user_inbox.rs @@ -52,11 +52,12 @@ use lemmy_db::{ source::{ community::{Community, CommunityFollower}, private_message::PrivateMessage, - user::User_, + user::User, }, ApubObject, Followable, }; +use lemmy_db_schema::source::user::User_; use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/lib.rs b/lemmy_apub/src/lib.rs index 78224c32e..991e782ed 100644 --- a/lemmy_apub/src/lib.rs +++ b/lemmy_apub/src/lib.rs @@ -22,10 +22,8 @@ use activitystreams::{ }; use activitystreams_ext::{Ext1, Ext2}; use anyhow::{anyhow, Context}; -use lemmy_db::{ - source::{activity::Activity, user::User_}, - DbPool, -}; +use lemmy_db::{source::activity::Activity, DbPool}; +use lemmy_db_schema::source::user::User_; use lemmy_structs::blocking; use lemmy_utils::{location_info, settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/objects/comment.rs b/lemmy_apub/src/objects/comment.rs index 9dd035c5d..a753c8dbe 100644 --- a/lemmy_apub/src/objects/comment.rs +++ b/lemmy_apub/src/objects/comment.rs @@ -23,14 +23,11 @@ use activitystreams::{ prelude::*, }; use anyhow::{anyhow, Context}; -use lemmy_db::{ - source::{community::Community, user::User_}, - Crud, - DbPool, -}; +use lemmy_db::{source::community::Community, Crud, DbPool}; use lemmy_db_schema::source::{ comment::{Comment, CommentForm}, post::Post, + user::User_, }; use lemmy_structs::blocking; use lemmy_utils::{ diff --git a/lemmy_apub/src/objects/post.rs b/lemmy_apub/src/objects/post.rs index 7090cd163..ed5a5d9ca 100644 --- a/lemmy_apub/src/objects/post.rs +++ b/lemmy_apub/src/objects/post.rs @@ -20,12 +20,11 @@ use activitystreams::{ }; use activitystreams_ext::Ext1; use anyhow::Context; -use lemmy_db::{ - source::{community::Community, user::User_}, - Crud, - DbPool, +use lemmy_db::{source::community::Community, Crud, DbPool}; +use lemmy_db_schema::source::{ + post::{Post, PostForm}, + user::User_, }; -use lemmy_db_schema::source::post::{Post, PostForm}; use lemmy_structs::blocking; use lemmy_utils::{ location_info, diff --git a/lemmy_apub/src/objects/private_message.rs b/lemmy_apub/src/objects/private_message.rs index e69c28110..cf176dc69 100644 --- a/lemmy_apub/src/objects/private_message.rs +++ b/lemmy_apub/src/objects/private_message.rs @@ -20,13 +20,11 @@ use activitystreams::{ }; use anyhow::Context; use lemmy_db::{ - source::{ - private_message::{PrivateMessage, PrivateMessageForm}, - user::User_, - }, + source::private_message::{PrivateMessage, PrivateMessageForm}, Crud, DbPool, }; +use lemmy_db_schema::source::user::User_; use lemmy_structs::blocking; use lemmy_utils::{location_info, utils::convert_datetime, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/objects/user.rs b/lemmy_apub/src/objects/user.rs index 6862867a5..3ec1548d4 100644 --- a/lemmy_apub/src/objects/user.rs +++ b/lemmy_apub/src/objects/user.rs @@ -18,12 +18,11 @@ use activitystreams::{ }; use activitystreams_ext::Ext1; use anyhow::Context; -use lemmy_db::{ +use lemmy_db::{ApubObject, DbPool}; +use lemmy_db_schema::{ + naive_now, source::user::{UserForm, User_}, - ApubObject, - DbPool, }; -use lemmy_db_schema::naive_now; use lemmy_structs::blocking; use lemmy_utils::{ location_info, diff --git a/lemmy_db/Cargo.toml b/lemmy_db/Cargo.toml index 849dba8e7..0442d0145 100644 --- a/lemmy_db/Cargo.toml +++ b/lemmy_db/Cargo.toml @@ -18,7 +18,7 @@ strum = "0.20.0" strum_macros = "0.20.1" log = "0.4.11" sha2 = "0.9.2" -bcrypt = "0.9.0" url = { version = "2.2.0", features = ["serde"] } lazy_static = "1.4.0" regex = "1.4.2" +bcrypt = "0.9.0" diff --git a/lemmy_db/src/aggregates/community_aggregates.rs b/lemmy_db/src/aggregates/community_aggregates.rs index cb94e6325..f452892db 100644 --- a/lemmy_db/src/aggregates/community_aggregates.rs +++ b/lemmy_db/src/aggregates/community_aggregates.rs @@ -24,10 +24,7 @@ impl CommunityAggregates { mod tests { use crate::{ aggregates::community_aggregates::CommunityAggregates, - source::{ - community::{Community, CommunityFollower, CommunityFollowerForm, CommunityForm}, - user::{UserForm, User_}, - }, + source::community::{Community, CommunityFollower, CommunityFollowerForm, CommunityForm}, tests::establish_unpooled_connection, Crud, Followable, @@ -37,6 +34,7 @@ mod tests { use lemmy_db_schema::source::{ comment::{Comment, CommentForm}, post::{Post, PostForm}, + user::{UserForm, User_}, }; #[test] diff --git a/lemmy_db/src/aggregates/post_aggregates.rs b/lemmy_db/src/aggregates/post_aggregates.rs index 0b9bfa5fa..434e52fd9 100644 --- a/lemmy_db/src/aggregates/post_aggregates.rs +++ b/lemmy_db/src/aggregates/post_aggregates.rs @@ -26,10 +26,7 @@ impl PostAggregates { mod tests { use crate::{ aggregates::post_aggregates::PostAggregates, - source::{ - community::{Community, CommunityForm}, - user::{UserForm, User_}, - }, + source::community::{Community, CommunityForm}, tests::establish_unpooled_connection, Crud, Likeable, @@ -39,6 +36,7 @@ mod tests { use lemmy_db_schema::source::{ comment::{Comment, CommentForm}, post::{Post, PostForm, PostLike, PostLikeForm}, + user::{UserForm, User_}, }; #[test] diff --git a/lemmy_db/src/aggregates/site_aggregates.rs b/lemmy_db/src/aggregates/site_aggregates.rs index ea58b2166..7fafc8eff 100644 --- a/lemmy_db/src/aggregates/site_aggregates.rs +++ b/lemmy_db/src/aggregates/site_aggregates.rs @@ -22,10 +22,7 @@ impl SiteAggregates { mod tests { use crate::{ aggregates::site_aggregates::SiteAggregates, - source::{ - community::{Community, CommunityForm}, - user::{UserForm, User_}, - }, + source::community::{Community, CommunityForm}, tests::establish_unpooled_connection, Crud, ListingType, @@ -34,6 +31,7 @@ mod tests { use lemmy_db_schema::source::{ comment::{Comment, CommentForm}, post::{Post, PostForm}, + user::{UserForm, User_}, }; #[test] diff --git a/lemmy_db/src/aggregates/user_aggregates.rs b/lemmy_db/src/aggregates/user_aggregates.rs index 91fa7460d..61a1ae7cc 100644 --- a/lemmy_db/src/aggregates/user_aggregates.rs +++ b/lemmy_db/src/aggregates/user_aggregates.rs @@ -25,10 +25,7 @@ impl UserAggregates { mod tests { use crate::{ aggregates::user_aggregates::UserAggregates, - source::{ - community::{Community, CommunityForm}, - user::{UserForm, User_}, - }, + source::community::{Community, CommunityForm}, tests::establish_unpooled_connection, Crud, Likeable, @@ -38,6 +35,7 @@ mod tests { use lemmy_db_schema::source::{ comment::{Comment, CommentForm, CommentLike, CommentLikeForm}, post::{Post, PostForm, PostLike, PostLikeForm}, + user::{UserForm, User_}, }; #[test] diff --git a/lemmy_db/src/source/activity.rs b/lemmy_db/src/source/activity.rs index 38a353a4a..ca85cf9fb 100644 --- a/lemmy_db/src/source/activity.rs +++ b/lemmy_db/src/source/activity.rs @@ -98,15 +98,13 @@ impl Activity { #[cfg(test)] mod tests { use crate::{ - source::{ - activity::{Activity, ActivityForm}, - user::{UserForm, User_}, - }, + source::activity::{Activity, ActivityForm}, tests::establish_unpooled_connection, Crud, ListingType, SortType, }; + use lemmy_db_schema::source::user::{UserForm, User_}; use serde_json::Value; #[test] diff --git a/lemmy_db/src/source/comment.rs b/lemmy_db/src/source/comment.rs index 17e9d637a..010ca7da8 100644 --- a/lemmy_db/src/source/comment.rs +++ b/lemmy_db/src/source/comment.rs @@ -1,14 +1,118 @@ use crate::{ApubObject, Crud, Likeable, Saveable}; use diesel::{dsl::*, result::Error, *}; -use lemmy_db_schema::source::comment::{ - Comment, - CommentForm, - CommentLike, - CommentLikeForm, - CommentSaved, - CommentSavedForm, +use lemmy_db_schema::{ + naive_now, + source::comment::{ + Comment, + CommentForm, + CommentLike, + CommentLikeForm, + CommentSaved, + CommentSavedForm, + }, }; +pub trait Comment_ { + fn update_ap_id(conn: &PgConnection, comment_id: i32, apub_id: String) -> Result; + fn permadelete_for_creator( + conn: &PgConnection, + for_creator_id: i32, + ) -> Result, Error>; + fn update_deleted( + conn: &PgConnection, + comment_id: i32, + new_deleted: bool, + ) -> Result; + fn update_removed( + conn: &PgConnection, + comment_id: i32, + new_removed: bool, + ) -> Result; + fn update_removed_for_creator( + conn: &PgConnection, + for_creator_id: i32, + new_removed: bool, + ) -> Result, Error>; + fn update_read(conn: &PgConnection, comment_id: i32, new_read: bool) -> Result; + fn update_content( + conn: &PgConnection, + comment_id: i32, + new_content: &str, + ) -> Result; +} + +impl Comment_ for Comment { + fn update_ap_id(conn: &PgConnection, comment_id: i32, apub_id: String) -> Result { + use lemmy_db_schema::schema::comment::dsl::*; + + diesel::update(comment.find(comment_id)) + .set(ap_id.eq(apub_id)) + .get_result::(conn) + } + + fn permadelete_for_creator(conn: &PgConnection, for_creator_id: i32) -> Result, Error> { + use lemmy_db_schema::schema::comment::dsl::*; + diesel::update(comment.filter(creator_id.eq(for_creator_id))) + .set(( + content.eq("*Permananently Deleted*"), + deleted.eq(true), + updated.eq(naive_now()), + )) + .get_results::(conn) + } + + fn update_deleted( + conn: &PgConnection, + comment_id: i32, + new_deleted: bool, + ) -> Result { + use lemmy_db_schema::schema::comment::dsl::*; + diesel::update(comment.find(comment_id)) + .set((deleted.eq(new_deleted), updated.eq(naive_now()))) + .get_result::(conn) + } + + fn update_removed( + conn: &PgConnection, + comment_id: i32, + new_removed: bool, + ) -> Result { + use lemmy_db_schema::schema::comment::dsl::*; + diesel::update(comment.find(comment_id)) + .set((removed.eq(new_removed), updated.eq(naive_now()))) + .get_result::(conn) + } + + fn update_removed_for_creator( + conn: &PgConnection, + for_creator_id: i32, + new_removed: bool, + ) -> Result, Error> { + use lemmy_db_schema::schema::comment::dsl::*; + diesel::update(comment.filter(creator_id.eq(for_creator_id))) + .set((removed.eq(new_removed), updated.eq(naive_now()))) + .get_results::(conn) + } + + fn update_read(conn: &PgConnection, comment_id: i32, new_read: bool) -> Result { + use lemmy_db_schema::schema::comment::dsl::*; + diesel::update(comment.find(comment_id)) + .set(read.eq(new_read)) + .get_result::(conn) + } + + fn update_content( + conn: &PgConnection, + comment_id: i32, + new_content: &str, + ) -> Result { + use lemmy_db_schema::schema::comment::dsl::*; + diesel::update(comment.find(comment_id)) + .set((content.eq(new_content), updated.eq(naive_now()))) + .get_result::(conn) + } +} + impl Crud for Comment { fn read(conn: &PgConnection, comment_id: i32) -> Result { use lemmy_db_schema::schema::comment::dsl::*; @@ -101,7 +205,7 @@ impl Saveable for CommentSaved { #[cfg(test)] mod tests { use crate::{ - source::{community::*, user::*}, + source::community::*, tests::establish_unpooled_connection, Crud, Likeable, @@ -109,7 +213,11 @@ mod tests { Saveable, SortType, }; - use lemmy_db_schema::source::{comment::*, post::*}; + use lemmy_db_schema::source::{ + comment::*, + post::*, + user::{UserForm, User_}, + }; #[test] fn test_crud() { diff --git a/lemmy_db/src/source/community.rs b/lemmy_db/src/source/community.rs index 13045cca7..795ed1232 100644 --- a/lemmy_db/src/source/community.rs +++ b/lemmy_db/src/source/community.rs @@ -421,12 +421,8 @@ impl Followable for CommunityFollower { #[cfg(test)] mod tests { - use crate::{ - source::{community::*, user::*}, - tests::establish_unpooled_connection, - ListingType, - SortType, - }; + use crate::{source::community::*, tests::establish_unpooled_connection, ListingType, SortType}; + use lemmy_db_schema::source::user::*; #[test] fn test_crud() { diff --git a/lemmy_db/src/source/moderator.rs b/lemmy_db/src/source/moderator.rs index eb6c2d566..ddb1407dc 100644 --- a/lemmy_db/src/source/moderator.rs +++ b/lemmy_db/src/source/moderator.rs @@ -391,12 +391,12 @@ impl Crud for ModAdd { #[cfg(test)] mod tests { use crate::{ - source::{community::*, moderator::*, user::*}, + source::{community::*, moderator::*}, tests::establish_unpooled_connection, ListingType, SortType, }; - use lemmy_db_schema::source::{comment::*, post::*}; + use lemmy_db_schema::source::{comment::*, post::*, user::*}; // use Crud; #[test] diff --git a/lemmy_db/src/source/password_reset_request.rs b/lemmy_db/src/source/password_reset_request.rs index 3c9969e41..ae38f1c1c 100644 --- a/lemmy_db/src/source/password_reset_request.rs +++ b/lemmy_db/src/source/password_reset_request.rs @@ -75,7 +75,6 @@ impl PasswordResetRequest { #[cfg(test)] mod tests { - use super::super::user::*; use crate::{ source::password_reset_request::PasswordResetRequest, tests::establish_unpooled_connection, @@ -83,6 +82,7 @@ mod tests { ListingType, SortType, }; + use lemmy_db_schema::source::user::*; #[test] fn test_crud() { diff --git a/lemmy_db/src/source/post.rs b/lemmy_db/src/source/post.rs index 5e8dc1cce..688ef39f3 100644 --- a/lemmy_db/src/source/post.rs +++ b/lemmy_db/src/source/post.rs @@ -1,14 +1,17 @@ use crate::{ApubObject, Crud, Likeable, Readable, Saveable}; use diesel::{dsl::*, result::Error, *}; -use lemmy_db_schema::source::post::{ - Post, - PostForm, - PostLike, - PostLikeForm, - PostRead, - PostReadForm, - PostSaved, - PostSavedForm, +use lemmy_db_schema::{ + naive_now, + source::post::{ + Post, + PostForm, + PostLike, + PostLikeForm, + PostRead, + PostReadForm, + PostSaved, + PostSavedForm, + }, }; impl Crud for Post { @@ -35,6 +38,119 @@ impl Crud for Post { } } +pub trait Post_ { + //fn read(conn: &PgConnection, post_id: i32) -> Result; + fn list_for_community(conn: &PgConnection, the_community_id: i32) -> Result, Error>; + fn update_ap_id(conn: &PgConnection, post_id: i32, apub_id: String) -> Result; + fn permadelete_for_creator(conn: &PgConnection, for_creator_id: i32) -> Result, Error>; + fn update_deleted(conn: &PgConnection, post_id: i32, new_deleted: bool) -> Result; + fn update_removed(conn: &PgConnection, post_id: i32, new_removed: bool) -> Result; + fn update_removed_for_creator( + conn: &PgConnection, + for_creator_id: i32, + for_community_id: Option, + new_removed: bool, + ) -> Result, Error>; + fn update_locked(conn: &PgConnection, post_id: i32, new_locked: bool) -> Result; + fn update_stickied(conn: &PgConnection, post_id: i32, new_stickied: bool) -> Result; + fn is_post_creator(user_id: i32, post_creator_id: i32) -> bool; +} + +impl Post_ for Post { + // TODO: this is a duplicate? + //fn read(conn: &PgConnection, post_id: i32) -> Result { + // use lemmy_db_schema::schema::post::dsl::*; + // post.filter(id.eq(post_id)).first::(conn) + //} + + fn list_for_community(conn: &PgConnection, the_community_id: i32) -> Result, Error> { + use lemmy_db_schema::schema::post::dsl::*; + post + .filter(community_id.eq(the_community_id)) + .then_order_by(published.desc()) + .then_order_by(stickied.desc()) + .limit(20) + .load::(conn) + } + + fn update_ap_id(conn: &PgConnection, post_id: i32, apub_id: String) -> Result { + use lemmy_db_schema::schema::post::dsl::*; + + diesel::update(post.find(post_id)) + .set(ap_id.eq(apub_id)) + .get_result::(conn) + } + + fn permadelete_for_creator(conn: &PgConnection, for_creator_id: i32) -> Result, Error> { + use lemmy_db_schema::schema::post::dsl::*; + + let perma_deleted = "*Permananently Deleted*"; + let perma_deleted_url = "https://deleted.com"; + + diesel::update(post.filter(creator_id.eq(for_creator_id))) + .set(( + name.eq(perma_deleted), + url.eq(perma_deleted_url), + body.eq(perma_deleted), + deleted.eq(true), + updated.eq(naive_now()), + )) + .get_results::(conn) + } + + fn update_deleted(conn: &PgConnection, post_id: i32, new_deleted: bool) -> Result { + use lemmy_db_schema::schema::post::dsl::*; + diesel::update(post.find(post_id)) + .set((deleted.eq(new_deleted), updated.eq(naive_now()))) + .get_result::(conn) + } + + fn update_removed(conn: &PgConnection, post_id: i32, new_removed: bool) -> Result { + use lemmy_db_schema::schema::post::dsl::*; + diesel::update(post.find(post_id)) + .set((removed.eq(new_removed), updated.eq(naive_now()))) + .get_result::(conn) + } + + fn update_removed_for_creator( + conn: &PgConnection, + for_creator_id: i32, + for_community_id: Option, + new_removed: bool, + ) -> Result, Error> { + use lemmy_db_schema::schema::post::dsl::*; + + let mut update = diesel::update(post).into_boxed(); + update = update.filter(creator_id.eq(for_creator_id)); + + if let Some(for_community_id) = for_community_id { + update = update.filter(community_id.eq(for_community_id)); + } + + update + .set((removed.eq(new_removed), updated.eq(naive_now()))) + .get_results::(conn) + } + + fn update_locked(conn: &PgConnection, post_id: i32, new_locked: bool) -> Result { + use lemmy_db_schema::schema::post::dsl::*; + diesel::update(post.find(post_id)) + .set(locked.eq(new_locked)) + .get_result::(conn) + } + + fn update_stickied(conn: &PgConnection, post_id: i32, new_stickied: bool) -> Result { + use lemmy_db_schema::schema::post::dsl::*; + diesel::update(post.find(post_id)) + .set(stickied.eq(new_stickied)) + .get_result::(conn) + } + + fn is_post_creator(user_id: i32, post_creator_id: i32) -> bool { + user_id == post_creator_id + } +} + impl ApubObject for Post { fn read_from_apub_id(conn: &PgConnection, object_id: &str) -> Result { use lemmy_db_schema::schema::post::dsl::*; @@ -116,11 +232,12 @@ impl Readable for PostRead { #[cfg(test)] mod tests { use crate::{ - source::{community::*, post::*, user::*}, + source::{community::*, post::*}, tests::establish_unpooled_connection, ListingType, SortType, }; + use lemmy_db_schema::source::user::*; #[test] fn test_crud() { diff --git a/lemmy_db/src/source/private_message.rs b/lemmy_db/src/source/private_message.rs index fd73a8646..1177eaa9a 100644 --- a/lemmy_db/src/source/private_message.rs +++ b/lemmy_db/src/source/private_message.rs @@ -140,11 +140,12 @@ impl PrivateMessage { #[cfg(test)] mod tests { use crate::{ - source::{private_message::*, user::*}, + source::private_message::*, tests::establish_unpooled_connection, ListingType, SortType, }; + use lemmy_db_schema::source::user::*; #[test] fn test_crud() { diff --git a/lemmy_db/src/source/user.rs b/lemmy_db/src/source/user.rs index 6bca769e8..7461f4b45 100644 --- a/lemmy_db/src/source/user.rs +++ b/lemmy_db/src/source/user.rs @@ -3,65 +3,15 @@ use bcrypt::{hash, DEFAULT_COST}; use diesel::{dsl::*, result::Error, *}; use lemmy_db_schema::{ naive_now, - schema::{user_, user_::dsl::*, user_alias_1, user_alias_2}, + schema::user_::dsl::*, + source::user::{UserForm, User_}, }; use lemmy_utils::settings::Settings; -use serde::Serialize; - -#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] -#[table_name = "user_"] -pub struct User_ { - pub id: i32, - pub name: String, - pub preferred_username: Option, - pub password_encrypted: String, - pub email: Option, - pub avatar: Option, - pub admin: bool, - pub banned: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, - pub show_nsfw: bool, - pub theme: String, - pub default_sort_type: i16, - pub default_listing_type: i16, - pub lang: String, - pub show_avatars: bool, - pub send_notifications_to_email: bool, - pub matrix_user_id: Option, - pub actor_id: String, - pub bio: Option, - pub local: bool, - pub private_key: Option, - pub public_key: Option, - pub last_refreshed_at: chrono::NaiveDateTime, - pub banner: Option, - pub deleted: bool, -} - -/// A safe representation of user, without the sensitive info -#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] -#[table_name = "user_"] -pub struct UserSafe { - pub id: i32, - pub name: String, - pub preferred_username: Option, - pub avatar: Option, - pub admin: bool, - pub banned: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, - pub matrix_user_id: Option, - pub actor_id: String, - pub bio: Option, - pub local: bool, - pub banner: Option, - pub deleted: bool, -} mod safe_type { - use crate::{source::user::User_, ToSafe}; - use lemmy_db_schema::schema::user_::columns::*; + use crate::ToSafe; + use lemmy_db_schema::{schema::user_::columns::*, source::user::User_}; + type Columns = ( id, name, @@ -102,59 +52,10 @@ mod safe_type { } } -#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] -#[table_name = "user_alias_1"] -pub struct UserAlias1 { - pub id: i32, - pub name: String, - pub preferred_username: Option, - pub password_encrypted: String, - pub email: Option, - pub avatar: Option, - pub admin: bool, - pub banned: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, - pub show_nsfw: bool, - pub theme: String, - pub default_sort_type: i16, - pub default_listing_type: i16, - pub lang: String, - pub show_avatars: bool, - pub send_notifications_to_email: bool, - pub matrix_user_id: Option, - pub actor_id: String, - pub bio: Option, - pub local: bool, - pub private_key: Option, - pub public_key: Option, - pub last_refreshed_at: chrono::NaiveDateTime, - pub banner: Option, - pub deleted: bool, -} - -#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] -#[table_name = "user_alias_1"] -pub struct UserSafeAlias1 { - pub id: i32, - pub name: String, - pub preferred_username: Option, - pub avatar: Option, - pub admin: bool, - pub banned: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, - pub matrix_user_id: Option, - pub actor_id: String, - pub bio: Option, - pub local: bool, - pub banner: Option, - pub deleted: bool, -} - mod safe_type_alias_1 { - use crate::{source::user::UserAlias1, ToSafe}; - use lemmy_db_schema::schema::user_alias_1::columns::*; + use crate::ToSafe; + use lemmy_db_schema::{schema::user_alias_1::columns::*, source::user::UserAlias1}; + type Columns = ( id, name, @@ -195,59 +96,10 @@ mod safe_type_alias_1 { } } -#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] -#[table_name = "user_alias_2"] -pub struct UserAlias2 { - pub id: i32, - pub name: String, - pub preferred_username: Option, - pub password_encrypted: String, - pub email: Option, - pub avatar: Option, - pub admin: bool, - pub banned: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, - pub show_nsfw: bool, - pub theme: String, - pub default_sort_type: i16, - pub default_listing_type: i16, - pub lang: String, - pub show_avatars: bool, - pub send_notifications_to_email: bool, - pub matrix_user_id: Option, - pub actor_id: String, - pub bio: Option, - pub local: bool, - pub private_key: Option, - pub public_key: Option, - pub last_refreshed_at: chrono::NaiveDateTime, - pub banner: Option, - pub deleted: bool, -} - -#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] -#[table_name = "user_alias_2"] -pub struct UserSafeAlias2 { - pub id: i32, - pub name: String, - pub preferred_username: Option, - pub avatar: Option, - pub admin: bool, - pub banned: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, - pub matrix_user_id: Option, - pub actor_id: String, - pub bio: Option, - pub local: bool, - pub banner: Option, - pub deleted: bool, -} - mod safe_type_alias_2 { - use crate::{source::user::UserAlias2, ToSafe}; - use lemmy_db_schema::schema::user_alias_2::columns::*; + use crate::ToSafe; + use lemmy_db_schema::{schema::user_alias_2::columns::*, source::user::UserAlias2}; + type Columns = ( id, name, @@ -288,35 +140,6 @@ mod safe_type_alias_2 { } } -#[derive(Insertable, AsChangeset, Clone)] -#[table_name = "user_"] -pub struct UserForm { - pub name: String, - pub preferred_username: Option>, - pub password_encrypted: String, - pub admin: bool, - pub banned: Option, - pub email: Option>, - pub avatar: Option>, - pub published: Option, - pub updated: Option, - pub show_nsfw: bool, - pub theme: String, - pub default_sort_type: i16, - pub default_listing_type: i16, - pub lang: String, - pub show_avatars: bool, - pub send_notifications_to_email: bool, - pub matrix_user_id: Option>, - pub actor_id: Option, - pub bio: Option>, - pub local: bool, - pub private_key: Option, - pub public_key: Option, - pub last_refreshed_at: Option, - pub banner: Option>, -} - impl Crud for User_ { fn read(conn: &PgConnection, user_id: i32) -> Result { user_ @@ -356,8 +179,26 @@ impl ApubObject for User_ { } } -impl User_ { - pub fn register(conn: &PgConnection, form: &UserForm) -> Result { +pub trait User { + fn register(conn: &PgConnection, form: &UserForm) -> Result; + fn update_password(conn: &PgConnection, user_id: i32, new_password: &str) + -> Result; + fn read_from_name(conn: &PgConnection, from_user_name: &str) -> Result; + fn add_admin(conn: &PgConnection, user_id: i32, added: bool) -> Result; + fn ban_user(conn: &PgConnection, user_id: i32, ban: bool) -> Result; + fn find_by_email_or_username( + conn: &PgConnection, + username_or_email: &str, + ) -> Result; + fn find_by_username(conn: &PgConnection, username: &str) -> Result; + fn find_by_email(conn: &PgConnection, from_email: &str) -> Result; + fn get_profile_url(&self, hostname: &str) -> String; + fn mark_as_updated(conn: &PgConnection, user_id: i32) -> Result; + fn delete_account(conn: &PgConnection, user_id: i32) -> Result; +} + +impl User for User_ { + fn register(conn: &PgConnection, form: &UserForm) -> Result { let mut edited_user = form.clone(); let password_hash = hash(&form.password_encrypted, DEFAULT_COST).expect("Couldn't hash password"); @@ -367,11 +208,7 @@ impl User_ { } // TODO do more individual updates like these - pub fn update_password( - conn: &PgConnection, - user_id: i32, - new_password: &str, - ) -> Result { + fn update_password(conn: &PgConnection, user_id: i32, new_password: &str) -> Result { let password_hash = hash(new_password, DEFAULT_COST).expect("Couldn't hash password"); diesel::update(user_.find(user_id)) @@ -382,7 +219,7 @@ impl User_ { .get_result::(conn) } - pub fn read_from_name(conn: &PgConnection, from_user_name: &str) -> Result { + fn read_from_name(conn: &PgConnection, from_user_name: &str) -> Result { user_ .filter(local.eq(true)) .filter(deleted.eq(false)) @@ -390,19 +227,19 @@ impl User_ { .first::(conn) } - pub fn add_admin(conn: &PgConnection, user_id: i32, added: bool) -> Result { + fn add_admin(conn: &PgConnection, user_id: i32, added: bool) -> Result { diesel::update(user_.find(user_id)) .set(admin.eq(added)) .get_result::(conn) } - pub fn ban_user(conn: &PgConnection, user_id: i32, ban: bool) -> Result { + fn ban_user(conn: &PgConnection, user_id: i32, ban: bool) -> Result { diesel::update(user_.find(user_id)) .set(banned.eq(ban)) .get_result::(conn) } - pub fn find_by_email_or_username( + fn find_by_email_or_username( conn: &PgConnection, username_or_email: &str, ) -> Result { @@ -413,7 +250,7 @@ impl User_ { } } - pub fn find_by_username(conn: &PgConnection, username: &str) -> Result { + fn find_by_username(conn: &PgConnection, username: &str) -> Result { user_ .filter(deleted.eq(false)) .filter(local.eq(true)) @@ -421,7 +258,7 @@ impl User_ { .first::(conn) } - pub fn find_by_email(conn: &PgConnection, from_email: &str) -> Result { + fn find_by_email(conn: &PgConnection, from_email: &str) -> Result { user_ .filter(deleted.eq(false)) .filter(local.eq(true)) @@ -429,7 +266,7 @@ impl User_ { .first::(conn) } - pub fn get_profile_url(&self, hostname: &str) -> String { + fn get_profile_url(&self, hostname: &str) -> String { format!( "{}://{}/u/{}", Settings::get().get_protocol_string(), @@ -438,13 +275,13 @@ impl User_ { ) } - pub fn mark_as_updated(conn: &PgConnection, user_id: i32) -> Result { + fn mark_as_updated(conn: &PgConnection, user_id: i32) -> Result { diesel::update(user_.find(user_id)) .set((last_refreshed_at.eq(naive_now()),)) .get_result::(conn) } - pub fn delete_account(conn: &PgConnection, user_id: i32) -> Result { + fn delete_account(conn: &PgConnection, user_id: i32) -> Result { diesel::update(user_.find(user_id)) .set(( preferred_username.eq::>(None), diff --git a/lemmy_db/src/source/user_mention.rs b/lemmy_db/src/source/user_mention.rs index 5df172864..64e24d32b 100644 --- a/lemmy_db/src/source/user_mention.rs +++ b/lemmy_db/src/source/user_mention.rs @@ -79,12 +79,12 @@ impl UserMention { #[cfg(test)] mod tests { use crate::{ - source::{community::*, user::*, user_mention::*}, + source::{community::*, user_mention::*}, tests::establish_unpooled_connection, ListingType, SortType, }; - use lemmy_db_schema::source::{comment::*, post::*}; + use lemmy_db_schema::source::{comment::*, post::*, user::*}; #[test] fn test_crud() { diff --git a/lemmy_db/src/views/comment_report_view.rs b/lemmy_db/src/views/comment_report_view.rs index b067a9ec1..0bfd6fe8d 100644 --- a/lemmy_db/src/views/comment_report_view.rs +++ b/lemmy_db/src/views/comment_report_view.rs @@ -3,7 +3,6 @@ use crate::{ source::{ comment_report::CommentReport, community::{Community, CommunitySafe}, - user::{UserAlias1, UserAlias2, UserSafe, UserSafeAlias1, UserSafeAlias2, User_}, }, views::ViewToVec, MaybeOptional, @@ -12,7 +11,11 @@ use crate::{ use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{comment, comment_report, community, post, user_, user_alias_1, user_alias_2}, - source::{comment::Comment, post::Post}, + source::{ + comment::Comment, + post::Post, + user::{UserAlias1, UserAlias2, UserSafe, UserSafeAlias1, UserSafeAlias2, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/comment_view.rs b/lemmy_db/src/views/comment_view.rs index d4680a341..3628b5838 100644 --- a/lemmy_db/src/views/comment_view.rs +++ b/lemmy_db/src/views/comment_view.rs @@ -3,10 +3,7 @@ use crate::{ functions::hot_rank, fuzzy_search, limit_and_offset, - source::{ - community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, - user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, - }, + source::community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, views::ViewToVec, ListingType, MaybeOptional, @@ -31,6 +28,7 @@ use lemmy_db_schema::{ source::{ comment::{Comment, CommentAlias1, CommentSaved}, post::Post, + user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, }, }; use serde::Serialize; @@ -412,14 +410,14 @@ impl ViewToVec for CommentView { #[cfg(test)] mod tests { use crate::{ - source::{community::*, user::*}, + source::community::*, tests::establish_unpooled_connection, views::comment_view::*, Crud, Likeable, *, }; - use lemmy_db_schema::source::{comment::*, post::*}; + use lemmy_db_schema::source::{comment::*, post::*, user::*}; #[test] fn test_crud() { diff --git a/lemmy_db/src/views/community/community_follower_view.rs b/lemmy_db/src/views/community/community_follower_view.rs index 243b91420..144481ce1 100644 --- a/lemmy_db/src/views/community/community_follower_view.rs +++ b/lemmy_db/src/views/community/community_follower_view.rs @@ -1,13 +1,13 @@ use crate::{ - source::{ - community::{Community, CommunitySafe}, - user::{UserSafe, User_}, - }, + source::community::{Community, CommunitySafe}, views::ViewToVec, ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{community, community_follower, user_}; +use lemmy_db_schema::{ + schema::{community, community_follower, user_}, + source::user::{UserSafe, User_}, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/community/community_moderator_view.rs b/lemmy_db/src/views/community/community_moderator_view.rs index 8762b9750..ffd2f6229 100644 --- a/lemmy_db/src/views/community/community_moderator_view.rs +++ b/lemmy_db/src/views/community/community_moderator_view.rs @@ -1,13 +1,13 @@ use crate::{ - source::{ - community::{Community, CommunitySafe}, - user::{UserSafe, User_}, - }, + source::community::{Community, CommunitySafe}, views::ViewToVec, ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{community, community_moderator, user_}; +use lemmy_db_schema::{ + schema::{community, community_moderator, user_}, + source::user::{UserSafe, User_}, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/community/community_user_ban_view.rs b/lemmy_db/src/views/community/community_user_ban_view.rs index 5dba4ebd3..80ac78cc3 100644 --- a/lemmy_db/src/views/community/community_user_ban_view.rs +++ b/lemmy_db/src/views/community/community_user_ban_view.rs @@ -1,12 +1,12 @@ use crate::{ - source::{ - community::{Community, CommunitySafe}, - user::{UserSafe, User_}, - }, + source::community::{Community, CommunitySafe}, ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{community, community_user_ban, user_}; +use lemmy_db_schema::{ + schema::{community, community_user_ban, user_}, + source::user::{UserSafe, User_}, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/community/community_view.rs b/lemmy_db/src/views/community/community_view.rs index 6c951b337..bd7119364 100644 --- a/lemmy_db/src/views/community/community_view.rs +++ b/lemmy_db/src/views/community/community_view.rs @@ -6,7 +6,6 @@ use crate::{ source::{ category::Category, community::{Community, CommunityFollower, CommunitySafe}, - user::{UserSafe, User_}, }, views::ViewToVec, MaybeOptional, @@ -14,12 +13,9 @@ use crate::{ ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{ - category, - community, - community_aggregates, - community_follower, - user_, +use lemmy_db_schema::{ + schema::{category, community, community_aggregates, community_follower, user_}, + source::user::{UserSafe, User_}, }; use serde::Serialize; diff --git a/lemmy_db/src/views/moderator/mod_add_community_view.rs b/lemmy_db/src/views/moderator/mod_add_community_view.rs index 1dd7cfc47..2e0483221 100644 --- a/lemmy_db/src/views/moderator/mod_add_community_view.rs +++ b/lemmy_db/src/views/moderator/mod_add_community_view.rs @@ -3,13 +3,15 @@ use crate::{ source::{ community::{Community, CommunitySafe}, moderator::ModAddCommunity, - user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, }, views::ViewToVec, ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{community, mod_add_community, user_, user_alias_1}; +use lemmy_db_schema::{ + schema::{community, mod_add_community, user_, user_alias_1}, + source::user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_add_view.rs b/lemmy_db/src/views/moderator/mod_add_view.rs index 06648ad76..c724e826c 100644 --- a/lemmy_db/src/views/moderator/mod_add_view.rs +++ b/lemmy_db/src/views/moderator/mod_add_view.rs @@ -1,14 +1,9 @@ -use crate::{ - limit_and_offset, - source::{ - moderator::ModAdd, - user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, - }, - views::ViewToVec, - ToSafe, -}; +use crate::{limit_and_offset, source::moderator::ModAdd, views::ViewToVec, ToSafe}; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{mod_add, user_, user_alias_1}; +use lemmy_db_schema::{ + schema::{mod_add, user_, user_alias_1}, + source::user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_ban_from_community_view.rs b/lemmy_db/src/views/moderator/mod_ban_from_community_view.rs index 3992518bc..e31d6d19b 100644 --- a/lemmy_db/src/views/moderator/mod_ban_from_community_view.rs +++ b/lemmy_db/src/views/moderator/mod_ban_from_community_view.rs @@ -3,13 +3,15 @@ use crate::{ source::{ community::{Community, CommunitySafe}, moderator::ModBanFromCommunity, - user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, }, views::ViewToVec, ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{community, mod_ban_from_community, user_, user_alias_1}; +use lemmy_db_schema::{ + schema::{community, mod_ban_from_community, user_, user_alias_1}, + source::user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_ban_view.rs b/lemmy_db/src/views/moderator/mod_ban_view.rs index 52e890259..2a3edb6c0 100644 --- a/lemmy_db/src/views/moderator/mod_ban_view.rs +++ b/lemmy_db/src/views/moderator/mod_ban_view.rs @@ -1,14 +1,9 @@ -use crate::{ - limit_and_offset, - source::{ - moderator::ModBan, - user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, - }, - views::ViewToVec, - ToSafe, -}; +use crate::{limit_and_offset, source::moderator::ModBan, views::ViewToVec, ToSafe}; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{mod_ban, user_, user_alias_1}; +use lemmy_db_schema::{ + schema::{mod_ban, user_, user_alias_1}, + source::user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_lock_post_view.rs b/lemmy_db/src/views/moderator/mod_lock_post_view.rs index 685d83bbc..9687e1b58 100644 --- a/lemmy_db/src/views/moderator/mod_lock_post_view.rs +++ b/lemmy_db/src/views/moderator/mod_lock_post_view.rs @@ -3,7 +3,6 @@ use crate::{ source::{ community::{Community, CommunitySafe}, moderator::ModLockPost, - user::{UserSafe, User_}, }, views::ViewToVec, ToSafe, @@ -11,7 +10,10 @@ use crate::{ use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, mod_lock_post, post, user_}, - source::post::Post, + source::{ + post::Post, + user::{UserSafe, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/moderator/mod_remove_comment_view.rs b/lemmy_db/src/views/moderator/mod_remove_comment_view.rs index 0c6519de0..70fb8cbdf 100644 --- a/lemmy_db/src/views/moderator/mod_remove_comment_view.rs +++ b/lemmy_db/src/views/moderator/mod_remove_comment_view.rs @@ -3,7 +3,6 @@ use crate::{ source::{ community::{Community, CommunitySafe}, moderator::ModRemoveComment, - user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, }, views::ViewToVec, ToSafe, @@ -11,7 +10,11 @@ use crate::{ use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{comment, community, mod_remove_comment, post, user_, user_alias_1}, - source::{comment::Comment, post::Post}, + source::{ + comment::Comment, + post::Post, + user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/moderator/mod_remove_community_view.rs b/lemmy_db/src/views/moderator/mod_remove_community_view.rs index 1700ac2d9..9e7fb6a45 100644 --- a/lemmy_db/src/views/moderator/mod_remove_community_view.rs +++ b/lemmy_db/src/views/moderator/mod_remove_community_view.rs @@ -3,13 +3,15 @@ use crate::{ source::{ community::{Community, CommunitySafe}, moderator::ModRemoveCommunity, - user::{UserSafe, User_}, }, views::ViewToVec, ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{community, mod_remove_community, user_}; +use lemmy_db_schema::{ + schema::{community, mod_remove_community, user_}, + source::user::{UserSafe, User_}, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/moderator/mod_remove_post_view.rs b/lemmy_db/src/views/moderator/mod_remove_post_view.rs index 98aefd211..fe976c8ea 100644 --- a/lemmy_db/src/views/moderator/mod_remove_post_view.rs +++ b/lemmy_db/src/views/moderator/mod_remove_post_view.rs @@ -3,7 +3,6 @@ use crate::{ source::{ community::{Community, CommunitySafe}, moderator::ModRemovePost, - user::{UserSafe, User_}, }, views::ViewToVec, ToSafe, @@ -11,7 +10,10 @@ use crate::{ use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, mod_remove_post, post, user_}, - source::post::Post, + source::{ + post::Post, + user::{UserSafe, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/moderator/mod_sticky_post_view.rs b/lemmy_db/src/views/moderator/mod_sticky_post_view.rs index 40672f8b1..c51d083f0 100644 --- a/lemmy_db/src/views/moderator/mod_sticky_post_view.rs +++ b/lemmy_db/src/views/moderator/mod_sticky_post_view.rs @@ -3,7 +3,6 @@ use crate::{ source::{ community::{Community, CommunitySafe}, moderator::ModStickyPost, - user::{UserSafe, User_}, }, views::ViewToVec, ToSafe, @@ -11,7 +10,10 @@ use crate::{ use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, mod_sticky_post, post, user_}, - source::post::Post, + source::{ + post::Post, + user::{UserSafe, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/post_report_view.rs b/lemmy_db/src/views/post_report_view.rs index 5e1862399..9c42f7769 100644 --- a/lemmy_db/src/views/post_report_view.rs +++ b/lemmy_db/src/views/post_report_view.rs @@ -3,7 +3,6 @@ use crate::{ source::{ community::{Community, CommunitySafe}, post_report::PostReport, - user::{UserAlias1, UserAlias2, UserSafe, UserSafeAlias1, UserSafeAlias2, User_}, }, views::ViewToVec, MaybeOptional, @@ -12,7 +11,10 @@ use crate::{ use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, post, post_report, user_, user_alias_1, user_alias_2}, - source::post::Post, + source::{ + post::Post, + user::{UserAlias1, UserAlias2, UserSafe, UserSafeAlias1, UserSafeAlias2, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/post_view.rs b/lemmy_db/src/views/post_view.rs index fb3fbbf3f..e3bdd178f 100644 --- a/lemmy_db/src/views/post_view.rs +++ b/lemmy_db/src/views/post_view.rs @@ -3,10 +3,7 @@ use crate::{ functions::hot_rank, fuzzy_search, limit_and_offset, - source::{ - community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, - user::{UserSafe, User_}, - }, + source::community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, views::ViewToVec, ListingType, MaybeOptional, @@ -26,7 +23,10 @@ use lemmy_db_schema::{ post_saved, user_, }, - source::post::{Post, PostRead, PostSaved}, + source::{ + post::{Post, PostRead, PostSaved}, + user::{UserSafe, User_}, + }, }; use serde::Serialize; @@ -408,14 +408,14 @@ impl ViewToVec for PostView { mod tests { use crate::{ aggregates::post_aggregates::PostAggregates, - source::{community::*, user::*}, + source::community::*, tests::establish_unpooled_connection, views::post_view::{PostQueryBuilder, PostView}, Crud, Likeable, *, }; - use lemmy_db_schema::source::post::*; + use lemmy_db_schema::source::{post::*, user::*}; #[test] fn test_crud() { diff --git a/lemmy_db/src/views/private_message_view.rs b/lemmy_db/src/views/private_message_view.rs index 5d594b12e..fa5319765 100644 --- a/lemmy_db/src/views/private_message_view.rs +++ b/lemmy_db/src/views/private_message_view.rs @@ -1,15 +1,15 @@ use crate::{ limit_and_offset, - source::{ - private_message::PrivateMessage, - user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, - }, + source::private_message::PrivateMessage, views::ViewToVec, MaybeOptional, ToSafe, }; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{private_message, user_, user_alias_1}; +use lemmy_db_schema::{ + schema::{private_message, user_, user_alias_1}, + source::user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, +}; use serde::Serialize; #[derive(Debug, PartialEq, Serialize, Clone)] diff --git a/lemmy_db/src/views/site_view.rs b/lemmy_db/src/views/site_view.rs index d956e2e1a..362c808de 100644 --- a/lemmy_db/src/views/site_view.rs +++ b/lemmy_db/src/views/site_view.rs @@ -1,12 +1,9 @@ -use crate::{ - source::{ - site::Site, - user::{UserSafe, User_}, - }, - ToSafe, -}; +use crate::{source::site::Site, ToSafe}; use diesel::{result::Error, *}; -use lemmy_db_schema::schema::{site, user_}; +use lemmy_db_schema::{ + schema::{site, user_}, + source::user::{UserSafe, User_}, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db/src/views/user_mention_view.rs b/lemmy_db/src/views/user_mention_view.rs index 61fb56260..61a788a40 100644 --- a/lemmy_db/src/views/user_mention_view.rs +++ b/lemmy_db/src/views/user_mention_view.rs @@ -4,7 +4,6 @@ use crate::{ limit_and_offset, source::{ community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, - user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, user_mention::UserMention, }, views::ViewToVec, @@ -30,6 +29,7 @@ use lemmy_db_schema::{ source::{ comment::{Comment, CommentSaved}, post::Post, + user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/user_view.rs b/lemmy_db/src/views/user_view.rs index 8f59691a6..f3109011e 100644 --- a/lemmy_db/src/views/user_view.rs +++ b/lemmy_db/src/views/user_view.rs @@ -2,14 +2,16 @@ use crate::{ aggregates::user_aggregates::UserAggregates, fuzzy_search, limit_and_offset, - source::user::{UserSafe, User_}, views::ViewToVec, MaybeOptional, SortType, ToSafe, }; use diesel::{dsl::*, result::Error, *}; -use lemmy_db_schema::schema::{user_, user_aggregates}; +use lemmy_db_schema::{ + schema::{user_, user_aggregates}, + source::user::{UserSafe, User_}, +}; use serde::Serialize; #[derive(Debug, Serialize, Clone)] diff --git a/lemmy_db_schema/src/lib.rs b/lemmy_db_schema/src/lib.rs index 11451d173..3868a3b75 100644 --- a/lemmy_db_schema/src/lib.rs +++ b/lemmy_db_schema/src/lib.rs @@ -6,6 +6,7 @@ use chrono::NaiveDateTime; pub mod schema; pub mod source; +// TODO: can probably move this back to lemmy_db pub fn naive_now() -> NaiveDateTime { chrono::prelude::Utc::now().naive_utc() } diff --git a/lemmy_db_schema/src/source/comment.rs b/lemmy_db_schema/src/source/comment.rs index 345776403..8c553a51a 100644 --- a/lemmy_db_schema/src/source/comment.rs +++ b/lemmy_db_schema/src/source/comment.rs @@ -1,9 +1,7 @@ use crate::{ - naive_now, schema::{comment, comment_alias_1, comment_like, comment_saved}, source::post::Post, }; -use diesel::{result::Error, PgConnection, *}; use serde::Serialize; use url::{ParseError, Url}; @@ -66,85 +64,6 @@ pub struct CommentForm { pub local: bool, } -impl Comment { - pub fn update_ap_id( - conn: &PgConnection, - comment_id: i32, - apub_id: String, - ) -> Result { - use crate::schema::comment::dsl::*; - - diesel::update(comment.find(comment_id)) - .set(ap_id.eq(apub_id)) - .get_result::(conn) - } - - pub fn permadelete_for_creator( - conn: &PgConnection, - for_creator_id: i32, - ) -> Result, Error> { - use crate::schema::comment::dsl::*; - diesel::update(comment.filter(creator_id.eq(for_creator_id))) - .set(( - content.eq("*Permananently Deleted*"), - deleted.eq(true), - updated.eq(naive_now()), - )) - .get_results::(conn) - } - - pub fn update_deleted( - conn: &PgConnection, - comment_id: i32, - new_deleted: bool, - ) -> Result { - use crate::schema::comment::dsl::*; - diesel::update(comment.find(comment_id)) - .set((deleted.eq(new_deleted), updated.eq(naive_now()))) - .get_result::(conn) - } - - pub fn update_removed( - conn: &PgConnection, - comment_id: i32, - new_removed: bool, - ) -> Result { - use crate::schema::comment::dsl::*; - diesel::update(comment.find(comment_id)) - .set((removed.eq(new_removed), updated.eq(naive_now()))) - .get_result::(conn) - } - - pub fn update_removed_for_creator( - conn: &PgConnection, - for_creator_id: i32, - new_removed: bool, - ) -> Result, Error> { - use crate::schema::comment::dsl::*; - diesel::update(comment.filter(creator_id.eq(for_creator_id))) - .set((removed.eq(new_removed), updated.eq(naive_now()))) - .get_results::(conn) - } - - pub fn update_read(conn: &PgConnection, comment_id: i32, new_read: bool) -> Result { - use crate::schema::comment::dsl::*; - diesel::update(comment.find(comment_id)) - .set(read.eq(new_read)) - .get_result::(conn) - } - - pub fn update_content( - conn: &PgConnection, - comment_id: i32, - new_content: &str, - ) -> Result { - use crate::schema::comment::dsl::*; - diesel::update(comment.find(comment_id)) - .set((content.eq(new_content), updated.eq(naive_now()))) - .get_result::(conn) - } -} - impl CommentForm { pub fn get_ap_id(&self) -> Result { Url::parse(&self.ap_id.as_ref().unwrap_or(&"not_a_url".to_string())) diff --git a/lemmy_db_schema/src/source/mod.rs b/lemmy_db_schema/src/source/mod.rs index 38203b5eb..2a5d7a699 100644 --- a/lemmy_db_schema/src/source/mod.rs +++ b/lemmy_db_schema/src/source/mod.rs @@ -1,2 +1,3 @@ pub mod comment; pub mod post; +pub mod user; diff --git a/lemmy_db_schema/src/source/post.rs b/lemmy_db_schema/src/source/post.rs index a0b974e2d..b0cc78e0e 100644 --- a/lemmy_db_schema/src/source/post.rs +++ b/lemmy_db_schema/src/source/post.rs @@ -1,8 +1,4 @@ -use crate::{ - naive_now, - schema::{post, post_like, post_read, post_saved}, -}; -use diesel::{result::Error, *}; +use crate::schema::{post, post_like, post_read, post_saved}; use serde::Serialize; use url::{ParseError, Url}; @@ -53,118 +49,6 @@ pub struct PostForm { pub local: bool, } -impl Post { - pub fn read(conn: &PgConnection, post_id: i32) -> Result { - use crate::schema::post::dsl::*; - post.filter(id.eq(post_id)).first::(conn) - } - - pub fn list_for_community( - conn: &PgConnection, - the_community_id: i32, - ) -> Result, Error> { - use crate::schema::post::dsl::*; - post - .filter(community_id.eq(the_community_id)) - .then_order_by(published.desc()) - .then_order_by(stickied.desc()) - .limit(20) - .load::(conn) - } - - pub fn update_ap_id(conn: &PgConnection, post_id: i32, apub_id: String) -> Result { - use crate::schema::post::dsl::*; - - diesel::update(post.find(post_id)) - .set(ap_id.eq(apub_id)) - .get_result::(conn) - } - - pub fn permadelete_for_creator( - conn: &PgConnection, - for_creator_id: i32, - ) -> Result, Error> { - use crate::schema::post::dsl::*; - - let perma_deleted = "*Permananently Deleted*"; - let perma_deleted_url = "https://deleted.com"; - - diesel::update(post.filter(creator_id.eq(for_creator_id))) - .set(( - name.eq(perma_deleted), - url.eq(perma_deleted_url), - body.eq(perma_deleted), - deleted.eq(true), - updated.eq(naive_now()), - )) - .get_results::(conn) - } - - pub fn update_deleted( - conn: &PgConnection, - post_id: i32, - new_deleted: bool, - ) -> Result { - use crate::schema::post::dsl::*; - diesel::update(post.find(post_id)) - .set((deleted.eq(new_deleted), updated.eq(naive_now()))) - .get_result::(conn) - } - - pub fn update_removed( - conn: &PgConnection, - post_id: i32, - new_removed: bool, - ) -> Result { - use crate::schema::post::dsl::*; - diesel::update(post.find(post_id)) - .set((removed.eq(new_removed), updated.eq(naive_now()))) - .get_result::(conn) - } - - pub fn update_removed_for_creator( - conn: &PgConnection, - for_creator_id: i32, - for_community_id: Option, - new_removed: bool, - ) -> Result, Error> { - use crate::schema::post::dsl::*; - - let mut update = diesel::update(post).into_boxed(); - update = update.filter(creator_id.eq(for_creator_id)); - - if let Some(for_community_id) = for_community_id { - update = update.filter(community_id.eq(for_community_id)); - } - - update - .set((removed.eq(new_removed), updated.eq(naive_now()))) - .get_results::(conn) - } - - pub fn update_locked(conn: &PgConnection, post_id: i32, new_locked: bool) -> Result { - use crate::schema::post::dsl::*; - diesel::update(post.find(post_id)) - .set(locked.eq(new_locked)) - .get_result::(conn) - } - - pub fn update_stickied( - conn: &PgConnection, - post_id: i32, - new_stickied: bool, - ) -> Result { - use crate::schema::post::dsl::*; - diesel::update(post.find(post_id)) - .set(stickied.eq(new_stickied)) - .get_result::(conn) - } - - pub fn is_post_creator(user_id: i32, post_creator_id: i32) -> bool { - user_id == post_creator_id - } -} - impl PostForm { pub fn get_ap_id(&self) -> Result { Url::parse(&self.ap_id.as_ref().unwrap_or(&"not_a_url".to_string())) diff --git a/lemmy_db_schema/src/source/user.rs b/lemmy_db_schema/src/source/user.rs new file mode 100644 index 000000000..3d9d9e500 --- /dev/null +++ b/lemmy_db_schema/src/source/user.rs @@ -0,0 +1,182 @@ +use crate::schema::{user_, user_alias_1, user_alias_2}; +use serde::Serialize; + +#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] +#[table_name = "user_"] +pub struct User_ { + pub id: i32, + pub name: String, + pub preferred_username: Option, + pub password_encrypted: String, + pub email: Option, + pub avatar: Option, + pub admin: bool, + pub banned: bool, + pub published: chrono::NaiveDateTime, + pub updated: Option, + pub show_nsfw: bool, + pub theme: String, + pub default_sort_type: i16, + pub default_listing_type: i16, + pub lang: String, + pub show_avatars: bool, + pub send_notifications_to_email: bool, + pub matrix_user_id: Option, + pub actor_id: String, + pub bio: Option, + pub local: bool, + pub private_key: Option, + pub public_key: Option, + pub last_refreshed_at: chrono::NaiveDateTime, + pub banner: Option, + pub deleted: bool, +} + +/// A safe representation of user, without the sensitive info +#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] +#[table_name = "user_"] +pub struct UserSafe { + pub id: i32, + pub name: String, + pub preferred_username: Option, + pub avatar: Option, + pub admin: bool, + pub banned: bool, + pub published: chrono::NaiveDateTime, + pub updated: Option, + pub matrix_user_id: Option, + pub actor_id: String, + pub bio: Option, + pub local: bool, + pub banner: Option, + pub deleted: bool, +} + +#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] +#[table_name = "user_alias_1"] +pub struct UserAlias1 { + pub id: i32, + pub name: String, + pub preferred_username: Option, + pub password_encrypted: String, + pub email: Option, + pub avatar: Option, + pub admin: bool, + pub banned: bool, + pub published: chrono::NaiveDateTime, + pub updated: Option, + pub show_nsfw: bool, + pub theme: String, + pub default_sort_type: i16, + pub default_listing_type: i16, + pub lang: String, + pub show_avatars: bool, + pub send_notifications_to_email: bool, + pub matrix_user_id: Option, + pub actor_id: String, + pub bio: Option, + pub local: bool, + pub private_key: Option, + pub public_key: Option, + pub last_refreshed_at: chrono::NaiveDateTime, + pub banner: Option, + pub deleted: bool, +} + +#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] +#[table_name = "user_alias_1"] +pub struct UserSafeAlias1 { + pub id: i32, + pub name: String, + pub preferred_username: Option, + pub avatar: Option, + pub admin: bool, + pub banned: bool, + pub published: chrono::NaiveDateTime, + pub updated: Option, + pub matrix_user_id: Option, + pub actor_id: String, + pub bio: Option, + pub local: bool, + pub banner: Option, + pub deleted: bool, +} + +#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] +#[table_name = "user_alias_2"] +pub struct UserAlias2 { + pub id: i32, + pub name: String, + pub preferred_username: Option, + pub password_encrypted: String, + pub email: Option, + pub avatar: Option, + pub admin: bool, + pub banned: bool, + pub published: chrono::NaiveDateTime, + pub updated: Option, + pub show_nsfw: bool, + pub theme: String, + pub default_sort_type: i16, + pub default_listing_type: i16, + pub lang: String, + pub show_avatars: bool, + pub send_notifications_to_email: bool, + pub matrix_user_id: Option, + pub actor_id: String, + pub bio: Option, + pub local: bool, + pub private_key: Option, + pub public_key: Option, + pub last_refreshed_at: chrono::NaiveDateTime, + pub banner: Option, + pub deleted: bool, +} + +#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] +#[table_name = "user_alias_2"] +pub struct UserSafeAlias2 { + pub id: i32, + pub name: String, + pub preferred_username: Option, + pub avatar: Option, + pub admin: bool, + pub banned: bool, + pub published: chrono::NaiveDateTime, + pub updated: Option, + pub matrix_user_id: Option, + pub actor_id: String, + pub bio: Option, + pub local: bool, + pub banner: Option, + pub deleted: bool, +} + +#[derive(Insertable, AsChangeset, Clone)] +#[table_name = "user_"] +pub struct UserForm { + pub name: String, + pub preferred_username: Option>, + pub password_encrypted: String, + pub admin: bool, + pub banned: Option, + pub email: Option>, + pub avatar: Option>, + pub published: Option, + pub updated: Option, + pub show_nsfw: bool, + pub theme: String, + pub default_sort_type: i16, + pub default_listing_type: i16, + pub lang: String, + pub show_avatars: bool, + pub send_notifications_to_email: bool, + pub matrix_user_id: Option>, + pub actor_id: Option, + pub bio: Option>, + pub local: bool, + pub private_key: Option, + pub public_key: Option, + pub last_refreshed_at: Option, + pub banner: Option>, +} diff --git a/lemmy_structs/src/lib.rs b/lemmy_structs/src/lib.rs index 595f6d074..7c3fc5c36 100644 --- a/lemmy_structs/src/lib.rs +++ b/lemmy_structs/src/lib.rs @@ -8,13 +8,13 @@ pub mod websocket; use diesel::PgConnection; use lemmy_db::{ source::{ - user::User_, + user::User, user_mention::{UserMention, UserMentionForm}, }, Crud, DbPool, }; -use lemmy_db_schema::source::{comment::Comment, post::Post}; +use lemmy_db_schema::source::{comment::Comment, post::Post, user::User_}; use lemmy_utils::{email::send_email, settings::Settings, utils::MentionData, LemmyError}; use log::error; use serde::{Deserialize, Serialize}; diff --git a/lemmy_structs/src/site.rs b/lemmy_structs/src/site.rs index 9209a5420..0d1542951 100644 --- a/lemmy_structs/src/site.rs +++ b/lemmy_structs/src/site.rs @@ -1,6 +1,6 @@ use lemmy_db::{ aggregates::site_aggregates::SiteAggregates, - source::{category::*, user::*}, + source::category::*, views::{ comment_view::CommentView, community::community_view::CommunityView, @@ -20,6 +20,7 @@ use lemmy_db::{ user_view::UserViewSafe, }, }; +use lemmy_db_schema::source::user::User_; use serde::{Deserialize, Serialize}; #[derive(Deserialize)] diff --git a/src/code_migrations.rs b/src/code_migrations.rs index c294be67c..2afdfabda 100644 --- a/src/code_migrations.rs +++ b/src/code_migrations.rs @@ -5,15 +5,20 @@ use diesel::{ }; use lemmy_db::{ source::{ + comment::Comment_, community::{Community, CommunityForm}, + post::Post_, private_message::PrivateMessage, - user::{UserForm, User_}, }, Crud, }; use lemmy_db_schema::{ naive_now, - source::{comment::Comment, post::Post}, + source::{ + comment::Comment, + post::Post, + user::{UserForm, User_}, + }, }; use lemmy_utils::{ apub::{generate_actor_keypair, make_apub_endpoint, EndpointType}, diff --git a/src/routes/feeds.rs b/src/routes/feeds.rs index 7a4801f40..8a3ecbae9 100644 --- a/src/routes/feeds.rs +++ b/src/routes/feeds.rs @@ -4,7 +4,7 @@ use chrono::{DateTime, NaiveDateTime, Utc}; use diesel::PgConnection; use lemmy_api::claims::Claims; use lemmy_db::{ - source::{community::Community, user::User_}, + source::{community::Community, user::User}, views::{ comment_view::{CommentQueryBuilder, CommentView}, post_view::{PostQueryBuilder, PostView}, @@ -14,6 +14,7 @@ use lemmy_db::{ ListingType, SortType, }; +use lemmy_db_schema::source::user::User_; use lemmy_structs::blocking; use lemmy_utils::{settings::Settings, utils::markdown_to_html, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/src/routes/webfinger.rs b/src/routes/webfinger.rs index d59b4e389..57c90c967 100644 --- a/src/routes/webfinger.rs +++ b/src/routes/webfinger.rs @@ -1,6 +1,7 @@ use actix_web::{error::ErrorBadRequest, web::Query, *}; use anyhow::anyhow; -use lemmy_db::source::{community::Community, user::User_}; +use lemmy_db::source::{community::Community, user::User}; +use lemmy_db_schema::source::user::User_; use lemmy_structs::{blocking, WebFingerLink, WebFingerResponse}; use lemmy_utils::{ settings::Settings, diff --git a/tests/integration_test.rs b/tests/integration_test.rs index a61c8ff6e..5a191352a 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -29,14 +29,12 @@ use lemmy_apub::{ }, }; use lemmy_db::{ - source::{ - community::{Community, CommunityForm}, - user::{User_, *}, - }, + source::community::{Community, CommunityForm}, Crud, ListingType, SortType, }; +use lemmy_db_schema::source::user::{UserForm, User_}; use lemmy_rate_limit::{rate_limiter::RateLimiter, RateLimit}; use lemmy_utils::{apub::generate_actor_keypair, settings::Settings}; use lemmy_websocket::{chat_server::ChatServer, LemmyContext}; From a7e231b35be41da3511bfca7d0babbf40f233811 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 21 Dec 2020 13:28:12 +0100 Subject: [PATCH 4/6] Move community to lemmy_db_schema --- cargo-timing-20201219T141435Z.html | 24823 ++++++++++++++++ cargo-timing-20201219T141946Z.html | 24104 +++++++++++++++ cargo-timing.html | 24104 +++++++++++++++ lemmy_api/src/community.rs | 10 +- lemmy_api/src/lib.rs | 8 +- lemmy_api/src/user.rs | 4 +- .../src/activities/receive/community.rs | 3 +- lemmy_apub/src/activities/send/comment.rs | 4 +- lemmy_apub/src/activities/send/community.rs | 7 +- lemmy_apub/src/activities/send/post.rs | 4 +- lemmy_apub/src/activities/send/user.rs | 10 +- lemmy_apub/src/activity_queue.rs | 4 +- lemmy_apub/src/fetcher.rs | 12 +- lemmy_apub/src/http/community.rs | 4 +- lemmy_apub/src/inbox/community_inbox.rs | 7 +- lemmy_apub/src/inbox/mod.rs | 8 +- lemmy_apub/src/inbox/shared_inbox.rs | 3 +- lemmy_apub/src/inbox/user_inbox.rs | 11 +- lemmy_apub/src/objects/comment.rs | 3 +- lemmy_apub/src/objects/community.rs | 7 +- lemmy_apub/src/objects/post.rs | 3 +- .../src/aggregates/community_aggregates.rs | 2 +- lemmy_db/src/aggregates/post_aggregates.rs | 2 +- lemmy_db/src/aggregates/site_aggregates.rs | 2 +- lemmy_db/src/aggregates/user_aggregates.rs | 2 +- lemmy_db/src/source/comment.rs | 2 +- lemmy_db/src/source/community.rs | 211 +- lemmy_db/src/source/moderator.rs | 5 +- lemmy_db/src/source/post.rs | 10 +- lemmy_db/src/source/user_mention.rs | 10 +- lemmy_db/src/views/comment_report_view.rs | 6 +- lemmy_db/src/views/comment_view.rs | 13 +- .../community/community_follower_view.rs | 11 +- .../community/community_moderator_view.rs | 11 +- .../community/community_user_ban_view.rs | 10 +- .../src/views/community/community_view.rs | 10 +- .../views/moderator/mod_add_community_view.rs | 15 +- .../moderator/mod_ban_from_community_view.rs | 15 +- .../src/views/moderator/mod_lock_post_view.rs | 11 +- .../moderator/mod_remove_comment_view.rs | 11 +- .../moderator/mod_remove_community_view.rs | 15 +- .../views/moderator/mod_remove_post_view.rs | 11 +- .../views/moderator/mod_sticky_post_view.rs | 11 +- lemmy_db/src/views/post_report_view.rs | 6 +- lemmy_db/src/views/post_view.rs | 5 +- lemmy_db/src/views/user_mention_view.rs | 6 +- lemmy_db_schema/src/source/community.rs | 121 + lemmy_db_schema/src/source/mod.rs | 1 + src/code_migrations.rs | 8 +- src/routes/feeds.rs | 4 +- src/routes/webfinger.rs | 4 +- tests/integration_test.rs | 10 +- 52 files changed, 73369 insertions(+), 335 deletions(-) create mode 100644 cargo-timing-20201219T141435Z.html create mode 100644 cargo-timing-20201219T141946Z.html create mode 100644 cargo-timing.html create mode 100644 lemmy_db_schema/src/source/community.rs diff --git a/cargo-timing-20201219T141435Z.html b/cargo-timing-20201219T141435Z.html new file mode 100644 index 000000000..ebcf35033 --- /dev/null +++ b/cargo-timing-20201219T141435Z.html @@ -0,0 +1,24823 @@ + + + + Cargo Build Timings — lemmy_server 0.0.1 + + + + + +

Cargo Build Timings

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Targets:lemmy_server 0.0.1 (bin "lemmy_server", lib)
Profile:dev
Fresh units:0
Dirty units:421
Total units:421
Max concurrency:12 (jobs=12 ncpu=12)
Build start:2020-12-19T14:14:35Z
Total time:224.1s (3m 44.1s)
rustc:rustc 1.50.0-nightly (825637983 2020-11-18)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency:0
+ + + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UnitTotalCodegenFeatures
1.lemmy_server v0.0.157.5s46.7s (81%)
2.lemmy_db v0.1.041.7s6.5s (15%)
3.diesel v1.4.522.1s0.4s (2%)32-column-tables, bitflags, chrono, default, postgres, pq-sys, r2d2, serde_json, with-deprecated
4.syn v1.0.5419.5s8.4s (43%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
5.image v0.23.1218.2s11.7s (65%)bmp, dds, default, dxt, farbfeld, gif, hdr, ico, jpeg, jpeg_rayon, png, pnm, scoped_threadpool, tga, tiff, webp
6.lemmy_server v0.0.1 bin "lemmy_server"17.4s0.0s (0%)
7.h2 v0.2.715.9s6.4s (40%)
8.openssl v0.10.3115.4s3.3s (21%)
9.trust-dns-proto v0.19.613.8s6.5s (47%)tokio, tokio-runtime
10.tokio v0.2.2413.6s5.2s (38%)blocking, default, fnv, futures-core, io-driver, io-util, iovec, lazy_static, libc, memchr, mio, mio-uds, rt-core, rt-util, signal, signal-hook-registry, slab, stream, sync, tcp, time, udp, uds, winapi
11.rustls v0.18.113.5s7.4s (55%)dangerous_configuration, default, log, logging
12.regex v1.4.213.5s10.7s (79%)aho-corasick, default, memchr, perf, perf-cache, perf-dfa, perf-inline, perf-literal, std, thread_local, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment
13.lettre v0.10.0-alpha.412.5s9.0s (72%)base64, builder, default, file-transport, hostname, hyperx, mime, native-tls, nom, quoted_printable, r2d2, rand, sendmail-transport, serde, serde_json, smtp-transport
14.pin-project-internal v0.4.2712.3s0.0s (0%)
15.serde_derive v1.0.11812.3s0.0s (0%)default
16.activitystreams v0.7.0-alpha.812.2s5.9s (49%)
17.lemmy_api v0.1.012.0s5.3s (45%)
18.nom v5.1.211.9s0.9s (7%)alloc, default, lexical, lexical-core, std
19.actix-server v1.0.411.8s10.3s (87%)default
20.lemmy_apub v0.1.011.5s5.3s (46%)
21.derive_more v0.99.1111.4s0.0s (0%)add, add_assign, as_mut, as_ref, constructor, default, deref, deref_mut, display, error, from, from_str, index, index_mut, into, into_iterator, iterator, mul, mul_assign, not, sum, try_into
22.regex-syntax v0.6.2110.9s5.1s (46%)default, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment
23.diesel_derives v1.4.110.5s0.0s (0%)default, postgres
24.object v0.22.010.4s4.2s (41%)archive, coff, elf, macho, pe, read_core, unaligned
25.jsonwebtoken v7.2.010.4s3.9s (38%)
26.lemmy_db_schema v0.1.010.3s0.7s (7%)
27.captcha v0.0.810.0s4.2s (42%)
28.nom v6.0.110.0s0.8s (8%)alloc, bitvec
29.comrak v0.9.010.0s2.1s (21%)
30.ring v0.16.199.6s6.0s (62%)alloc, default, dev_urandom_fallback, once_cell, std
31.hyper v0.13.99.0s1.0s (12%)socket2, tcp
32.serde-hjson v0.9.18.6s2.5s (29%)default, linked-hash-map, preserve_order
33.brotli-sys v0.3.2 custom-build (run)8.2s0.0s (0%)
34.encoding_rs v0.8.267.9s3.8s (48%)
35.backtrace v0.3.557.9s6.6s (84%)addr2line, default, gimli-symbolize, miniz_oxide, object, std
36.futures-util v0.3.87.8s0.4s (5%)alloc, async-await, async-await-macro, channel, default, futures-channel, futures-io, futures-macro, futures-sink, io, memchr, proc-macro-hack, proc-macro-nested, sink, slab, std
37.reqwest v0.10.107.7s3.1s (40%)__tls, default, default-tls, hyper-tls, json, native-tls-crate, serde_json, tokio-tls
38.gimli v0.23.07.7s1.4s (18%)read
39.strum_macros v0.20.17.5s0.0s (0%)
40.jpeg-decoder v0.1.207.4s0.8s (11%)rayon
41.http v0.2.27.4s1.9s (26%)
42.actix-http v2.2.07.1s1.2s (17%)actix-tls, brotli2, compress, default, flate2, rustls
43.v_escape_derive v0.8.47.1s0.0s (0%)
44.rand_chacha v0.2.27.0s1.7s (25%)std
45.rayon v1.5.06.7s0.5s (8%)
46.pest_meta v2.1.36.3s4.5s (71%)
47.lodepng v3.2.26.3s3.6s (57%)default, rust_backend
48.serde v1.0.1186.2s0.2s (3%)default, derive, serde_derive, std
49.num-bigint v0.2.66.2s1.2s (19%)default, std
50.pin-project-internal v1.0.26.1s0.0s (0%)
51.hyperx v1.2.06.1s3.1s (50%)headers
52.actix_derive v0.5.06.0s0.0s (0%)
53.darling_core v0.10.26.0s1.9s (32%)strsim, suggestions
54.actix-web v3.3.25.8s1.3s (22%)compress, default, rust-tls, rustls
55.num-rational v0.3.25.3s4.5s (86%)
56.trust-dns-resolver v0.19.65.3s2.3s (42%)ipconfig, resolv-conf, system-config, tokio, tokio-runtime
57.async-trait v0.1.425.2s0.0s (0%)
58.background-jobs-actix v0.8.05.1s0.5s (10%)
59.pem v0.8.24.9s0.5s (10%)
60.bitvec v0.19.44.9s0.1s (1%)alloc
61.serde v0.8.234.8s0.4s (7%)default, std
62.rayon-core v1.9.04.8s2.8s (59%)
63.awc v2.0.34.7s2.4s (51%)compress, rust-tls, rustls
64.thiserror-impl v1.0.224.6s0.0s (0%)
65.aho-corasick v0.7.154.6s2.5s (55%)default, std
66.cc v1.0.664.6s3.1s (68%)
67.lemmy_structs v0.1.04.4s0.3s (8%)
68.time v0.2.234.3s0.7s (17%)libc, std, stdweb, winapi
69.lexical-core v0.7.44.2s0.3s (8%)arrayvec, correct, default, ryu, static_assertions, std, table
70.env_logger v0.8.24.1s1.4s (34%)atty, default, humantime, regex, termcolor
71.rand v0.7.33.7s0.4s (12%)alloc, default, getrandom, getrandom_package, libc, std
72.futures-macro v0.3.83.6s0.0s (0%)
73.pest_generator v2.1.33.5s2.0s (59%)
74.serde_json v1.0.603.4s1.1s (32%)default, indexmap, preserve_order, std
75.mio v0.6.233.3s1.6s (47%)default, with-deprecated
76.proc-macro-hack v0.5.193.3s0.0s (0%)
77.tokio-tls v0.3.13.3s0.0s (0%)
78.miniz_oxide v0.3.73.3s1.7s (53%)
79.pest v2.1.33.2s0.5s (16%)
80.tokio v0.3.63.2s1.2s (38%)default, sync
81.derive_builder_core v0.9.03.2s0.9s (28%)
82.proc-macro2 v1.0.243.1s1.7s (54%)default, proc-macro
83.background-jobs-core v0.8.02.9s1.0s (34%)actix-rt, default, tokio, with-actix
84.chrono v0.4.192.9s0.6s (22%)clock, default, libc, oldtime, serde, std, time, winapi
85.ring v0.16.19 custom-build (run)2.7s0.0s (0%)alloc, default, dev_urandom_fallback, once_cell, std
86.itertools v0.9.02.7s0.5s (18%)default, use_std
87.lemmy_utils v0.1.02.6s0.6s (21%)
88.time-macros v0.1.12.6s0.0s (0%)
89.png v0.16.82.6s0.7s (27%)default, deflate, png-encoding
90.nom v4.2.32.5s0.7s (29%)alloc, default, std
91.miniz_oxide v0.4.32.5s1.1s (45%)no_extern_crate_alloc
92.webpki v0.21.42.5s0.8s (31%)default, std, trust_anchor_util
93.num-traits v0.2.142.5s0.2s (8%)default, i128, std
94.deflate v0.8.62.4s1.3s (52%)
95.actix v0.10.02.4s0.3s (12%)default, resolver, trust-dns-proto, trust-dns-resolver
96.unicode-normalization v0.1.162.4s0.4s (18%)default, std
97.language-tags v0.2.22.4s1.8s (75%)
98.actix-web-codegen v0.4.02.4s0.0s (0%)
99.actix-rt v1.1.12.3s1.3s (57%)
100.time-macros-impl v0.1.12.3s0.0s (0%)
101.funty v1.0.12.3s1.0s (44%)
102.resolv-conf v0.7.02.3s1.2s (51%)hostname, system
103.mime_guess v2.0.32.3s0.7s (29%)default, rev-mappings
104.ipnet v2.3.02.3s1.4s (60%)
105.unicode-bidi v0.3.42.2s1.4s (60%)default
106.tinyvec v1.1.02.2s0.0s (2%)alloc, default, tinyvec_macros
107.libc v0.2.812.1s0.2s (12%)align, default, std
108.thiserror v1.0.222.1s0.0s (1%)
109.idna v0.2.02.1s0.9s (40%)
110.bytes v0.6.02.1s0.7s (33%)default, std
111.lemmy_websocket v0.1.02.1s0.7s (32%)
112.config v0.10.12.1s0.6s (28%)hjson, serde-hjson
113.crossbeam-channel v0.5.02.1s0.4s (19%)crossbeam-utils, default, std
114.actix-utils v2.0.02.0s0.8s (40%)
115.url v2.2.02.0s0.4s (21%)serde
116.tracing-core v0.1.172.0s0.9s (46%)lazy_static, std
117.bytes v0.5.62.0s0.7s (35%)default, std
118.crossbeam-channel v0.4.41.9s0.4s (21%)
119.typenum v1.12.01.9s0.1s (3%)
120.mime_guess v2.0.3 custom-build1.9s0.0s (0%)default, rev-mappings
121.tiff v0.6.11.9s0.2s (12%)
122.autocfg v1.0.11.9s1.0s (50%)
123.scoped_threadpool v0.1.91.9s1.4s (76%)
124.typenum v1.12.0 custom-build1.9s0.0s (0%)
125.http-signature-normalization v0.5.31.9s1.1s (58%)
126.pkg-config v0.3.191.8s1.2s (67%)
127.const_fn v0.4.41.8s0.0s (0%)
128.crossbeam-epoch v0.9.11.8s0.7s (36%)alloc, lazy_static, std
129.crossbeam-utils v0.7.2 custom-build (run)1.8s0.0s (0%)default, lazy_static, std
130.enum-as-inner v0.3.31.8s0.0s (0%)
131.version_check v0.9.21.8s0.9s (50%)
132.flate2 v1.0.191.8s0.5s (28%)default, miniz_oxide, rust_backend
133.gif v0.11.11.8s0.7s (41%)default, raii_no_panic, std
134.crossbeam-utils v0.8.1 custom-build (run)1.7s0.0s (0%)default, lazy_static, std
135.quick-xml v0.17.21.7s0.8s (44%)default, encoding, encoding_rs
136.actix-files v0.4.11.7s0.4s (26%)
137.weezl v0.1.31.7s0.9s (54%)alloc, default, std
138.derive_builder v0.9.01.7s0.0s (0%)
139.actix-router v0.2.51.7s0.4s (24%)default, http
140.sha2 v0.9.21.7s0.8s (50%)default, std
141.ring v0.16.19 custom-build1.7s0.0s (0%)alloc, default, dev_urandom_fallback, once_cell, std
142.actix-macros v0.1.31.7s0.0s (0%)
143.v_htmlescape v0.11.01.6s0.4s (23%)bytes-buf, default
144.actix-service v1.0.61.6s0.0s (1%)
145.rss v1.9.01.6s0.4s (25%)builders, default, derive_builder
146.hashbrown v0.9.11.6s0.1s (4%)raw
147.time v0.1.441.6s0.7s (47%)
148.digest v0.9.01.6s0.0s (1%)alloc, std
149.migrations_macros v1.4.21.6s0.0s (0%)default
150.crossbeam-utils v0.8.11.5s0.7s (48%)default, lazy_static, std
151.signal-hook-registry v1.2.21.5s1.0s (65%)
152.openssl-sys v0.9.59 custom-build1.5s0.0s (0%)
153.simple_asn1 v0.4.11.5s0.7s (48%)
154.crossbeam-utils v0.7.21.5s0.7s (48%)default, lazy_static, std
155.memchr v2.3.41.5s0.5s (33%)default, std, use_std
156.unicode-segmentation v1.7.11.5s0.4s (24%)
157.cipher v0.2.51.5s0.0s (1%)
158.xdg v2.2.01.5s1.0s (66%)
159.http-signature-normalization-actix v0.4.11.4s0.2s (14%)base64, digest, sha-2, sha2
160.darling_macro v0.10.21.4s0.0s (0%)
161.num_cpus v1.13.01.4s0.9s (63%)
162.rustc-demangle v0.1.181.4s0.7s (49%)
163.strsim v0.9.31.4s0.8s (57%)
164.byteorder v1.3.4 custom-build1.4s0.0s (0%)default, std
165.hyperx v1.2.0 custom-build1.4s0.0s (0%)headers
166.openssl-sys v0.9.591.3s0.1s (11%)
167.libc v0.2.81 custom-build1.3s0.0s (0%)align, default, std
168.uuid v0.8.11.3s0.3s (25%)default, rand, serde, std, v4
169.termcolor v1.1.21.3s0.7s (50%)
170.serde_test v0.8.231.3s0.2s (13%)
171.httparse v1.3.4 custom-build1.3s0.0s (0%)default, std
172.arrayvec v0.5.21.3s0.0s (3%)array-sizes-33-128, default, std
173.version_check v0.1.51.3s0.9s (66%)
174.net2 v0.2.371.3s0.6s (49%)default, duration
175.pest_derive v2.1.01.3s0.0s (0%)
176.proc-macro2 v1.0.24 custom-build1.3s0.0s (0%)default, proc-macro
177.actix-connect v2.0.01.3s0.2s (17%)default, http, rust-tls, rustls, tokio-rustls, uri, webpki
178.syn v1.0.54 custom-build1.3s0.0s (0%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
179.quote v1.0.71.3s0.6s (48%)default, proc-macro
180.socket2 v0.3.181.3s0.6s (50%)
181.parking_lot v0.11.11.2s0.7s (55%)default
182.native-tls v0.2.61.2s0.4s (34%)
183.const_fn v0.4.4 custom-build1.2s0.0s (0%)
184.threadpool v1.8.11.2s0.8s (67%)
185.anyhow v1.0.351.2s0.7s (54%)default, std
186.indexmap v1.6.11.2s0.2s (13%)
187.scheduled-thread-pool v0.2.51.2s0.4s (34%)
188.base64 v0.13.01.2s0.3s (28%)default, std
189.ucd-trie v0.1.31.2s0.8s (68%)default, std
190.num-integer v0.1.441.2s0.3s (28%)i128, std
191.ppv-lite86 v0.2.101.2s0.0s (3%)simd, std
192.log v0.4.11 custom-build1.2s0.0s (0%)std
193.brotli2 v0.3.21.2s0.5s (46%)
194.memchr v2.3.4 custom-build1.2s0.0s (0%)default, std, use_std
195.parking_lot_core v0.8.11.1s0.5s (41%)
196.addr2line v0.14.01.1s0.4s (34%)
197.serde_json v1.0.60 custom-build1.1s0.0s (0%)default, indexmap, preserve_order, std
198.tokio-util v0.3.11.1s0.2s (15%)codec, compat, default, full, futures-io, udp
199.pq-sys v0.4.6 custom-build1.1s0.0s (0%)
200.mime v0.3.161.1s0.5s (45%)
201.humantime v2.0.11.1s0.5s (44%)
202.sha-1 v0.9.21.0s0.4s (43%)default, std
203.ryu v1.0.5 custom-build1.0s0.0s (0%)
204.log v0.4.111.0s0.4s (40%)std
205.base64 v0.12.31.0s0.3s (26%)default, std
206.color_quant v1.1.01.0s0.6s (58%)
207.bcrypt v0.9.01.0s0.5s (52%)default, std
208.generic-array v0.14.41.0s0.0s (3%)
209.activitystreams-ext v0.1.0-alpha.21.0s0.0s (4%)
210.byteorder v1.3.41.0s0.2s (17%)default, std
211.rgb v0.8.251.0s0.0s (4%)as-bytes, bytemuck, default
212.actix-web-actors v3.0.01.0s0.2s (22%)
213.httparse v1.3.41.0s0.4s (40%)default, std
214.hound v3.4.01.0s0.3s (26%)
215.cookie v0.14.31.0s0.3s (27%)percent-encode, percent-encoding
216.migrations_internals v1.4.11.0s0.2s (16%)default
217.bitflags v1.2.1 custom-build0.9s0.0s (0%)default
218.thread_local v1.0.10.9s0.4s (48%)
219.pin-project-internal v0.4.27 custom-build0.9s0.0s (0%)
220.serde_derive v1.0.118 custom-build0.9s0.0s (0%)default
221.unicase v2.6.0 custom-build (run)0.9s0.0s (0%)
222.twoway v0.2.10.9s0.4s (45%)default, use_std
223.proc-macro-hack v0.5.19 custom-build0.9s0.0s (0%)
224.lemmy_rate_limit v0.1.00.9s0.2s (17%)
225.tracing v0.1.220.9s0.3s (32%)log, std
226.actix-tls v2.0.00.9s0.1s (13%)default, rust-tls, rustls, tokio-rustls, webpki, webpki-roots
227.futures-executor v0.3.80.9s0.3s (36%)std
228.proc-macro-nested v0.1.6 custom-build0.9s0.0s (0%)
229.quoted_printable v0.4.20.9s0.4s (44%)
230.event-listener v2.5.10.8s0.4s (52%)
231.percent-encoding v2.1.00.8s0.4s (50%)
232.crc32fast v1.2.10.8s0.4s (46%)default, std
233.miniz_oxide v0.4.3 custom-build (run)0.8s0.0s (0%)no_extern_crate_alloc
234.entities v1.0.10.8s0.2s (24%)
235.httpdate v0.3.20.8s0.4s (48%)
236.unicase v2.6.00.8s0.3s (43%)
237.serde v1.0.118 custom-build0.8s0.0s (0%)default, derive, serde_derive, std
238.heck v0.3.10.8s0.4s (52%)
239.crc32fast v1.2.1 custom-build0.8s0.0s (0%)default, std
240.futures-channel v0.3.80.8s0.1s (10%)alloc, default, futures-sink, sink, std
241.ryu v1.0.50.8s0.3s (39%)
242.r2d2 v0.8.90.8s0.2s (23%)
243.indexmap v1.6.1 custom-build (run)0.8s0.0s (0%)
244.maybe-uninit v2.0.0 custom-build0.8s0.0s (0%)
245.num-traits v0.2.14 custom-build (run)0.8s0.0s (0%)default, i128, std
246.sct v0.6.00.8s0.4s (46%)
247.actix-threadpool v0.3.30.8s0.2s (27%)
248.num-rational v0.3.2 custom-build (run)0.7s0.0s (0%)
249.tokio-rustls v0.14.10.7s0.0s (5%)
250.serde_urlencoded v0.7.00.7s0.1s (14%)
251.anyhow v1.0.35 custom-build0.7s0.0s (0%)default, std
252.crossbeam-deque v0.8.00.7s0.0s (3%)crossbeam-epoch, crossbeam-utils, default, std
253.num-iter v0.1.42 custom-build (run)0.7s0.0s (0%)default, std
254.num-bigint v0.2.6 custom-build (run)0.7s0.0s (0%)default, std
255.standback v0.2.13 custom-build0.7s0.0s (0%)std
256.getrandom v0.2.00.7s0.3s (37%)std
257.getrandom v0.1.15 custom-build0.7s0.0s (0%)std
258.unicode-xid v0.2.10.7s0.0s (7%)default
259.getrandom v0.1.150.7s0.2s (34%)std
260.lazy_static v1.4.00.7s0.0s (3%)
261.form_urlencoded v1.0.00.7s0.3s (48%)
262.radium v0.5.3 custom-build0.7s0.0s (0%)
263.smallvec v1.5.10.7s0.0s (6%)
264.rayon v1.5.0 custom-build (run)0.7s0.0s (0%)
265.mio-uds v0.6.80.7s0.1s (19%)
266.futures-io v0.3.80.7s0.3s (48%)default, std
267.pq-sys v0.4.60.7s0.2s (37%)
268.actix-testing v1.0.10.7s0.1s (22%)
269.unicode_categories v0.1.10.7s0.1s (17%)
270.getrandom v0.2.0 custom-build0.6s0.0s (0%)std
271.once_cell v1.5.20.6s0.2s (33%)alloc, default, std
272.lock_api v0.4.20.6s0.0s (7%)
273.blowfish v0.7.00.6s0.1s (23%)bcrypt
274.radium v0.5.30.6s0.0s (6%)
275.want v0.3.00.6s0.2s (40%)
276.futures-core v0.3.80.6s0.2s (41%)alloc, default, std
277.num-bigint v0.2.6 custom-build0.6s0.0s (0%)default, std
278.actix-codec v0.3.00.6s0.0s (7%)
279.futures-task v0.3.80.6s0.2s (30%)alloc, once_cell, std
280.openssl-probe v0.1.20.6s0.3s (49%)
281.rand_core v0.5.10.6s0.1s (22%)alloc, getrandom, std
282.time v0.2.23 custom-build0.6s0.0s (0%)libc, std, stdweb, winapi
283.openssl v0.10.31 custom-build0.6s0.0s (0%)
284.brotli-sys v0.3.2 custom-build0.6s0.0s (0%)
285.shell-words v1.0.00.6s0.3s (49%)
286.memoffset v0.6.1 custom-build (run)0.6s0.0s (0%)default
287.tokio v0.3.6 custom-build (run)0.6s0.0s (0%)default, sync
288.hyper-tls v0.4.30.6s0.0s (7%)
289.v_htmlescape v0.11.0 custom-build0.5s0.0s (0%)bytes-buf, default
290.bytestring v0.1.50.5s0.2s (32%)
291.indexmap v1.6.1 custom-build0.5s0.0s (0%)
292.http-signature-normalization-reqwest v0.1.30.5s0.1s (17%)base64, digest, sha-2, sha2, tokio
293.nom v4.2.3 custom-build0.5s0.0s (0%)alloc, default, std
294.either v1.6.10.5s0.0s (7%)default, use_std
295.hostname v0.3.10.5s0.2s (44%)default
296.crossbeam-utils v0.7.2 custom-build0.5s0.0s (0%)default, lazy_static, std
297.nom v6.0.1 custom-build0.5s0.0s (0%)alloc, bitvec
298.crossbeam-utils v0.8.1 custom-build0.5s0.0s (0%)default, lazy_static, std
299.adler v0.2.30.5s0.2s (40%)
300.iovec v0.1.40.5s0.2s (45%)
301.adler32 v1.2.00.5s0.2s (38%)default, std
302.generic-array v0.14.4 custom-build0.5s0.0s (0%)
303.memoffset v0.6.1 custom-build0.5s0.0s (0%)default
304.linked-hash-map v0.3.00.5s0.0s (6%)serde, serde_impl, serde_test
305.lexical-core v0.7.4 custom-build0.5s0.0s (0%)arrayvec, correct, default, ryu, static_assertions, std, table
306.num-integer v0.1.44 custom-build0.5s0.0s (0%)i128, std
307.linked-hash-map v0.5.30.5s0.0s (3%)
308.native-tls v0.2.6 custom-build0.5s0.0s (0%)
309.pin-project v1.0.20.5s0.0s (1%)
310.untrusted v0.7.10.5s0.1s (27%)
311.brotli-sys v0.3.20.5s0.0s (5%)
312.unicase v2.6.0 custom-build0.5s0.0s (0%)
313.miniz_oxide v0.4.3 custom-build0.5s0.0s (0%)no_extern_crate_alloc
314.num-rational v0.3.2 custom-build0.5s0.0s (0%)
315.cookie v0.14.3 custom-build0.5s0.0s (0%)percent-encode, percent-encoding
316.num-iter v0.1.42 custom-build0.5s0.0s (0%)default, std
317.tokio v0.3.6 custom-build0.5s0.0s (0%)default, sync
318.standback v0.2.13 custom-build (run)0.5s0.0s (0%)std
319.nom v5.1.2 custom-build0.5s0.0s (0%)alloc, default, lexical, lexical-core, std
320.rayon-core v1.9.0 custom-build0.5s0.0s (0%)
321.tracing-futures v0.2.40.4s0.0s (5%)pin-project, std-future
322.bytemuck v1.4.10.4s0.0s (9%)
323.rayon v1.5.0 custom-build0.4s0.0s (0%)
324.wyz v0.2.00.4s0.0s (3%)alloc
325.anyhow v1.0.35 custom-build (run)0.4s0.0s (0%)default, std
326.http-body v0.3.10.4s0.1s (18%)
327.v_escape v0.14.10.4s0.0s (6%)bytes-buf
328.num-traits v0.2.14 custom-build0.4s0.0s (0%)default, i128, std
329.spin v0.5.20.4s0.0s (9%)
330.openssl-sys v0.9.59 custom-build (run)0.4s0.0s (0%)
331.lru-cache v0.1.20.4s0.0s (7%)
332.typed-arena v1.7.00.4s0.0s (12%)default, std
333.itoa v0.4.60.4s0.0s (6%)default, std
334.slab v0.4.20.4s0.0s (9%)
335.encoding_rs v0.8.26 custom-build0.4s0.0s (0%)
336.pin-project v0.4.270.4s0.0s (3%)
337.v_escape v0.14.1 custom-build0.4s0.0s (0%)bytes-buf
338.derive_builder v0.9.0 custom-build0.4s0.0s (0%)
339.darling v0.10.20.4s0.0s (2%)default, suggestions
340.fnv v1.0.70.4s0.0s (2%)default, std
341.fxhash v0.2.10.4s0.1s (17%)
342.webpki-roots v0.20.00.4s0.0s (10%)
343.num-iter v0.1.420.4s0.0s (3%)default, std
344.ident_case v1.0.10.4s0.0s (12%)
345.background-jobs v0.8.00.3s0.0s (8%)background-jobs-actix, default
346.nom v5.1.2 custom-build (run)0.3s0.0s (0%)alloc, default, lexical, lexical-core, std
347.copyless v0.1.50.3s0.0s (14%)
348.strum v0.20.00.3s0.0s (8%)
349.buf-min v0.2.00.3s0.0s (15%)bytes, bytes-buf
350.block-buffer v0.9.00.3s0.0s (4%)
351.bitflags v1.2.10.3s0.1s (16%)default
352.proc-macro-nested v0.1.60.3s0.1s (20%)
353.tap v1.0.00.3s0.0s (14%)
354.futures-sink v0.3.80.3s0.0s (3%)alloc, default, std
355.maybe-uninit v2.0.00.3s0.0s (8%)
356.matches v0.1.80.3s0.0s (13%)
357.futures v0.3.80.3s0.0s (8%)alloc, async-await, default, executor, futures-executor, std
358.instant v0.1.90.3s0.0s (4%)
359.async-mutex v1.4.00.3s0.0s (6%)
360.unchecked-index v0.2.20.3s0.0s (5%)
361.generic-array v0.14.4 custom-build (run)0.3s0.0s (0%)
362.httparse v1.3.4 custom-build (run)0.3s0.0s (0%)default, std
363.standback v0.2.130.3s0.0s (6%)std
364.quick-error v1.2.30.3s0.0s (5%)
365.cookie v0.14.3 custom-build (run)0.3s0.0s (0%)percent-encode, percent-encoding
366.atty v0.2.140.3s0.0s (10%)
367.cfg-if v0.1.100.3s0.0s (2%)
368.cfg-if v1.0.00.3s0.0s (2%)
369.memoffset v0.6.10.3s0.0s (9%)default
370.maplit v1.0.20.2s0.0s (5%)
371.try-lock v0.2.30.2s0.0s (8%)
372.pin-utils v0.1.00.2s0.0s (11%)
373.tower-service v0.3.00.2s0.0s (9%)
374.syn v1.0.54 custom-build (run)0.2s0.0s (0%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
375.scopeguard v1.1.00.2s0.0s (8%)
376.pin-project-lite v0.2.00.2s0.0s (9%)
377.proc-macro2 v1.0.24 custom-build (run)0.2s0.0s (0%)default, proc-macro
378.nom v6.0.1 custom-build (run)0.2s0.0s (0%)alloc, bitvec
379.cpuid-bool v0.1.20.2s0.0s (15%)
380.pin-project-lite v0.1.110.2s0.0s (5%)
381.time v0.2.23 custom-build (run)0.2s0.0s (0%)libc, std, stdweb, winapi
382.num-traits v0.1.430.2s0.0s (8%)
383.serde_json v1.0.60 custom-build (run)0.2s0.0s (0%)default, indexmap, preserve_order, std
384.proc-macro-hack v0.5.19 custom-build (run)0.2s0.0s (0%)
385.static_assertions v1.1.00.2s0.0s (11%)
386.match_cfg v0.1.00.2s0.0s (5%)default, use_core
387.tinyvec_macros v0.1.00.2s0.0s (5%)
388.ryu v1.0.5 custom-build (run)0.2s0.0s (0%)
389.opaque-debug v0.3.00.2s0.0s (4%)
390.byteorder v1.3.4 custom-build (run)0.2s0.0s (0%)default, std
391.diesel_migrations v1.4.00.2s0.0s (16%)default
392.foreign-types-shared v0.1.10.2s0.0s (6%)
393.crc32fast v1.2.1 custom-build (run)0.2s0.0s (0%)default, std
394.foreign-types v0.3.20.2s0.0s (7%)
395.serde v1.0.118 custom-build (run)0.2s0.0s (0%)default, derive, serde_derive, std
396.hyperx v1.2.0 custom-build (run)0.2s0.0s (0%)headers
397.bitflags v1.2.1 custom-build (run)0.2s0.0s (0%)default
398.libc v0.2.81 custom-build (run)0.2s0.0s (0%)align, default, std
399.serde_derive v1.0.118 custom-build (run)0.2s0.0s (0%)default
400.pin-project-internal v0.4.27 custom-build (run)0.2s0.0s (0%)
401.const_fn v0.4.4 custom-build (run)0.2s0.0s (0%)
402.nom v4.2.3 custom-build (run)0.2s0.0s (0%)alloc, default, std
403.maybe-uninit v2.0.0 custom-build (run)0.2s0.0s (0%)
404.typenum v1.12.0 custom-build (run)0.1s0.0s (0%)
405.mime_guess v2.0.3 custom-build (run)0.0s0.0s (0%)default, rev-mappings
406.num-integer v0.1.44 custom-build (run)0.0s0.0s (0%)i128, std
407.lexical-core v0.7.4 custom-build (run)0.0s0.0s (0%)arrayvec, correct, default, ryu, static_assertions, std, table
408.getrandom v0.2.0 custom-build (run)0.0s0.0s (0%)std
409.openssl v0.10.31 custom-build (run)0.0s0.0s (0%)
410.derive_builder v0.9.0 custom-build (run)0.0s0.0s (0%)
411.radium v0.5.3 custom-build (run)0.0s0.0s (0%)
412.getrandom v0.1.15 custom-build (run)0.0s0.0s (0%)std
413.proc-macro-nested v0.1.6 custom-build (run)0.0s0.0s (0%)
414.pq-sys v0.4.6 custom-build (run)0.0s0.0s (0%)
415.log v0.4.11 custom-build (run)0.0s0.0s (0%)std
416.v_htmlescape v0.11.0 custom-build (run)0.0s0.0s (0%)bytes-buf, default
417.native-tls v0.2.6 custom-build (run)0.0s0.0s (0%)
418.v_escape v0.14.1 custom-build (run)0.0s0.0s (0%)bytes-buf
419.rayon-core v1.9.0 custom-build (run)0.0s0.0s (0%)
420.encoding_rs v0.8.26 custom-build (run)0.0s0.0s (0%)
421.memchr v2.3.4 custom-build (run)0.0s0.0s (0%)default, std, use_std
+ + + diff --git a/cargo-timing-20201219T141946Z.html b/cargo-timing-20201219T141946Z.html new file mode 100644 index 000000000..c14605108 --- /dev/null +++ b/cargo-timing-20201219T141946Z.html @@ -0,0 +1,24104 @@ + + + + Cargo Build Timings — lemmy_server 0.0.1 + + + + + +

Cargo Build Timings

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Targets:lemmy_server 0.0.1 (lib, bin "lemmy_server")
Profile:dev
Fresh units:0
Dirty units:421
Total units:421
Max concurrency:12 (jobs=12 ncpu=12)
Build start:2020-12-19T14:19:46Z
Total time:191.9s (3m 11.9s)
rustc:rustc 1.50.0-nightly (825637983 2020-11-18)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency:0
+ + + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UnitTotalCodegenFeatures
1.lemmy_db v0.1.045.2s6.9s (15%)
2.diesel v1.4.523.2s0.6s (2%)32-column-tables, bitflags, chrono, default, postgres, pq-sys, r2d2, serde_json, with-deprecated
3.syn v1.0.5419.5s7.8s (40%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
4.h2 v0.2.718.6s8.8s (47%)
5.lemmy_server v0.0.118.4s13.2s (72%)
6.serde_derive v1.0.11816.5s0.0s (0%)default
7.lemmy_server v0.0.1 bin "lemmy_server"15.8s0.0s (0%)
8.diesel_derives v1.4.114.2s0.0s (0%)default, postgres
9.hyper v0.13.914.2s0.8s (6%)socket2, tcp
10.derive_more v0.99.1114.1s0.0s (0%)add, add_assign, as_mut, as_ref, constructor, default, deref, deref_mut, display, error, from, from_str, index, index_mut, into, into_iterator, iterator, mul, mul_assign, not, sum, try_into
11.activitystreams v0.7.0-alpha.813.3s2.7s (20%)
12.trust-dns-proto v0.19.612.9s8.6s (66%)tokio, tokio-runtime
13.regex-syntax v0.6.2112.8s5.0s (39%)default, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment
14.image v0.23.1212.6s5.5s (44%)bmp, dds, default, dxt, farbfeld, gif, hdr, ico, jpeg, jpeg_rayon, png, pnm, scoped_threadpool, tga, tiff, webp
15.lettre v0.10.0-alpha.412.4s1.6s (13%)base64, builder, default, file-transport, hostname, hyperx, mime, native-tls, nom, quoted_printable, r2d2, rand, sendmail-transport, serde, serde_json, smtp-transport
16.pin-project-internal v0.4.2712.2s0.0s (0%)
17.async-trait v0.1.4211.9s0.0s (0%)
18.regex v1.4.211.5s8.6s (75%)aho-corasick, default, memchr, perf, perf-cache, perf-dfa, perf-inline, perf-literal, std, thread_local, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment
19.thiserror-impl v1.0.2211.2s0.0s (0%)
20.trust-dns-resolver v0.19.611.0s2.8s (25%)ipconfig, resolv-conf, system-config, tokio, tokio-runtime
21.rayon v1.5.010.5s0.8s (8%)
22.object v0.22.010.4s4.3s (41%)archive, coff, elf, macho, pe, read_core, unaligned
23.lemmy_api v0.1.010.2s4.7s (46%)
24.lemmy_apub v0.1.010.2s4.3s (42%)
25.tokio v0.2.2410.1s2.9s (29%)blocking, default, fnv, futures-core, io-driver, io-util, iovec, lazy_static, libc, memchr, mio, mio-uds, rt-core, rt-util, signal, signal-hook-registry, slab, stream, sync, tcp, time, udp, uds, winapi
26.lemmy_db_schema v0.1.09.6s0.8s (9%)
27.rustls v0.18.19.2s3.7s (40%)dangerous_configuration, default, log, logging
28.strum_macros v0.20.19.2s0.0s (0%)
29.darling_macro v0.10.28.5s0.0s (0%)
30.comrak v0.9.08.3s3.9s (47%)
31.openssl v0.10.318.2s2.8s (34%)
32.brotli-sys v0.3.2 custom-build (run)8.2s0.0s (0%)
33.actix_derive v0.5.08.2s0.0s (0%)
34.encoding_rs v0.8.267.7s3.8s (49%)
35.darling_core v0.10.27.7s2.3s (30%)strsim, suggestions
36.gimli v0.23.07.6s1.3s (17%)read
37.pin-project-internal v1.0.27.6s0.0s (0%)
38.futures-util v0.3.87.4s0.3s (4%)alloc, async-await, async-await-macro, channel, default, futures-channel, futures-io, futures-macro, futures-sink, io, memchr, proc-macro-hack, proc-macro-nested, sink, slab, std
39.rand v0.7.37.3s0.9s (12%)alloc, default, getrandom, getrandom_package, libc, std
40.rayon-core v1.9.07.1s5.5s (78%)
41.pest_generator v2.1.37.1s1.6s (23%)
42.http v0.2.27.0s1.9s (27%)
43.serde v1.0.1186.8s0.7s (11%)default, derive, serde_derive, std
44.ring v0.16.196.7s3.6s (53%)alloc, default, dev_urandom_fallback, once_cell, std
45.pest_meta v2.1.36.6s4.9s (75%)
46.hyperx v1.2.06.3s3.2s (50%)headers
47.actix-web v3.3.26.1s1.5s (25%)compress, default, rust-tls, rustls
48.cc v1.0.665.9s3.9s (66%)
49.actix-http v2.2.05.7s1.0s (19%)actix-tls, brotli2, compress, default, flate2, rustls
50.nom v6.0.15.6s0.5s (9%)alloc, bitvec
51.nom v5.1.25.4s0.8s (14%)alloc, default, lexical, lexical-core, std
52.serde v0.8.235.3s0.3s (6%)default, std
53.reqwest v0.10.105.3s3.3s (62%)__tls, default, default-tls, hyper-tls, json, native-tls-crate, serde_json, tokio-tls
54.time v0.2.235.3s2.2s (42%)libc, std, stdweb, winapi
55.backtrace v0.3.555.1s4.0s (79%)addr2line, default, gimli-symbolize, miniz_oxide, object, std
56.bitvec v0.19.44.9s0.1s (1%)alloc
57.aho-corasick v0.7.154.9s2.7s (56%)default, std
58.ryu v1.0.5 custom-build4.8s0.0s (0%)
59.num-bigint v0.2.64.8s1.4s (30%)default, std
60.lemmy_structs v0.1.04.7s0.4s (8%)
61.lodepng v3.2.24.7s2.8s (59%)default, rust_backend
62.awc v2.0.34.5s3.0s (66%)compress, rust-tls, rustls
63.derive_builder v0.9.04.2s0.0s (0%)
64.tiff v0.6.14.2s2.8s (67%)
65.lexical-core v0.7.44.1s0.3s (7%)arrayvec, correct, default, ryu, static_assertions, std, table
66.actix-server v1.0.44.1s2.2s (52%)default
67.jpeg-decoder v0.1.204.0s2.1s (52%)rayon
68.serde_json v1.0.603.9s0.8s (21%)default, indexmap, preserve_order, std
69.serde-hjson v0.9.13.8s2.2s (59%)default, linked-hash-map, preserve_order
70.v_escape_derive v0.8.43.8s0.0s (0%)
71.futures-macro v0.3.83.7s0.0s (0%)
72.pest v2.1.33.5s0.5s (13%)
73.chrono v0.4.193.4s0.4s (13%)clock, default, libc, oldtime, serde, std, time, winapi
74.tokio v0.3.63.3s1.4s (41%)default, sync
75.rand_chacha v0.2.23.2s2.2s (69%)std
76.proc-macro-hack v0.5.193.1s0.0s (0%)
77.lemmy_utils v0.1.03.1s0.6s (21%)
78.mio v0.6.233.1s1.4s (45%)default, with-deprecated
79.typenum v1.12.0 custom-build3.0s0.0s (0%)
80.miniz_oxide v0.3.73.0s1.4s (48%)
81.proc-macro2 v1.0.243.0s1.6s (53%)default, proc-macro
82.actix v0.10.03.0s0.3s (9%)default, resolver, trust-dns-proto, trust-dns-resolver
83.ring v0.16.19 custom-build (run)3.0s0.0s (0%)alloc, default, dev_urandom_fallback, once_cell, std
84.config v0.10.13.0s1.5s (49%)hjson, serde-hjson
85.actix-web-codegen v0.4.03.0s0.0s (0%)
86.base64 v0.13.02.9s0.3s (12%)default, std
87.itertools v0.9.02.9s0.5s (17%)default, use_std
88.url v2.2.02.8s0.8s (30%)serde
89.pkg-config v0.3.192.8s1.2s (44%)
90.rss v1.9.02.8s0.7s (24%)builders, default, derive_builder
91.unicode-segmentation v1.7.12.7s0.3s (12%)
92.nom v4.2.32.7s1.0s (36%)alloc, default, std
93.bytes v0.5.62.7s0.5s (18%)default, std
94.httparse v1.3.4 custom-build2.6s0.0s (0%)default, std
95.unicode-normalization v0.1.162.6s0.4s (16%)default, std
96.time-macros-impl v0.1.12.6s0.0s (0%)
97.deflate v0.8.62.6s1.3s (52%)
98.idna v0.2.02.6s1.2s (45%)
99.env_logger v0.8.22.5s1.1s (45%)atty, default, humantime, regex, termcolor
100.png v0.16.82.5s1.1s (43%)default, deflate, png-encoding
101.num-rational v0.3.22.5s1.4s (56%)
102.sha2 v0.9.22.4s0.8s (32%)default, std
103.base64 v0.12.32.3s0.4s (15%)default, std
104.actix-router v0.2.52.3s0.7s (30%)default, http
105.language-tags v0.2.22.3s1.7s (74%)
106.miniz_oxide v0.4.32.3s1.2s (51%)no_extern_crate_alloc
107.mime_guess v2.0.3 custom-build2.3s0.0s (0%)default, rev-mappings
108.crc32fast v1.2.1 custom-build2.2s0.0s (0%)default, std
109.num-traits v0.2.142.2s0.2s (8%)default, i128, std
110.tinyvec v1.1.02.2s0.0s (1%)alloc, default, tinyvec_macros
111.mime v0.3.162.2s1.7s (78%)
112.funty v1.0.12.2s1.0s (47%)
113.ipnet v2.3.02.2s1.2s (54%)
114.v_htmlescape v0.11.02.1s0.6s (28%)bytes-buf, default
115.background-jobs-core v0.8.02.1s0.5s (22%)actix-rt, default, tokio, with-actix
116.tracing-core v0.1.172.1s1.0s (51%)lazy_static, std
117.bytes v0.6.02.1s0.6s (31%)default, std
118.lemmy_websocket v0.1.02.0s0.7s (36%)
119.bitflags v1.2.1 custom-build2.0s0.0s (0%)default
120.typenum v1.12.02.0s0.1s (3%)
121.actix-rt v1.1.12.0s1.1s (55%)
122.unicode-bidi v0.3.42.0s1.1s (57%)default
123.migrations_macros v1.4.22.0s0.0s (0%)default
124.libc v0.2.811.9s0.2s (10%)align, default, std
125.encoding_rs v0.8.26 custom-build1.9s0.0s (0%)
126.actix-files v0.4.11.9s0.6s (32%)
127.byteorder v1.3.4 custom-build1.9s0.0s (0%)default, std
128.proc-macro-nested v0.1.6 custom-build1.9s0.0s (0%)
129.derive_builder_core v0.9.01.9s1.0s (54%)
130.enum-as-inner v0.3.31.9s0.0s (0%)
131.percent-encoding v2.1.01.8s0.2s (13%)
132.scoped_threadpool v0.1.91.8s1.4s (78%)
133.actix-utils v2.0.01.8s0.5s (28%)
134.gif v0.11.11.8s0.7s (37%)default, raii_no_panic, std
135.serde_json v1.0.60 custom-build1.8s0.0s (0%)default, indexmap, preserve_order, std
136.smallvec v1.5.11.8s0.0s (3%)
137.crossbeam-channel v0.5.01.8s0.6s (33%)crossbeam-utils, default, std
138.pin-project-internal v0.4.27 custom-build1.8s0.0s (0%)
139.ring v0.16.19 custom-build1.7s0.0s (0%)alloc, default, dev_urandom_fallback, once_cell, std
140.crossbeam-channel v0.4.41.7s0.5s (30%)
141.signal-hook-registry v1.2.21.7s1.0s (56%)
142.quick-xml v0.17.21.7s0.7s (43%)default, encoding, encoding_rs
143.cookie v0.14.31.7s1.0s (61%)percent-encode, percent-encoding
144.const_fn v0.4.41.7s0.0s (0%)
145.actix-macros v0.1.31.7s0.0s (0%)
146.weezl v0.1.31.7s0.9s (54%)alloc, default, std
147.time v0.1.441.7s0.7s (43%)
148.http-signature-normalization v0.5.31.6s0.9s (57%)
149.mime_guess v2.0.31.6s0.4s (27%)default, rev-mappings
150.openssl-sys v0.9.59 custom-build1.6s0.0s (0%)
151.pem v0.8.21.6s1.1s (70%)
152.hashbrown v0.9.11.6s0.1s (3%)raw
153.openssl-sys v0.9.591.6s0.2s (11%)
154.jsonwebtoken v7.2.01.6s0.5s (34%)
155.webpki v0.21.41.6s0.7s (44%)default, std, trust_anchor_util
156.crossbeam-utils v0.8.1 custom-build (run)1.5s0.0s (0%)default, lazy_static, std
157.resolv-conf v0.7.01.5s0.8s (51%)hostname, system
158.http-signature-normalization-actix v0.4.11.5s0.4s (28%)base64, digest, sha-2, sha2
159.crossbeam-utils v0.7.2 custom-build (run)1.5s0.0s (0%)default, lazy_static, std
160.flate2 v1.0.191.5s0.4s (27%)default, miniz_oxide, rust_backend
161.crossbeam-utils v0.8.11.5s0.7s (47%)default, lazy_static, std
162.actix-service v1.0.61.5s0.0s (3%)
163.rustc-demangle v0.1.181.5s0.7s (49%)
164.autocfg v1.0.11.5s0.9s (63%)
165.crossbeam-utils v0.7.21.5s0.7s (45%)default, lazy_static, std
166.arrayvec v0.5.21.4s0.0s (2%)array-sizes-33-128, default, std
167.pest_derive v2.1.01.4s0.0s (0%)
168.simple_asn1 v0.4.11.4s0.7s (51%)
169.version_check v0.9.21.4s0.8s (57%)
170.serde_test v0.8.231.4s0.2s (11%)
171.xdg v2.2.01.4s0.8s (59%)
172.parking_lot v0.11.11.4s0.8s (58%)default
173.num_cpus v1.13.01.4s0.9s (63%)
174.threadpool v1.8.11.4s1.0s (73%)
175.actix-web-actors v3.0.01.3s0.5s (38%)
176.termcolor v1.1.21.3s0.6s (45%)
177.socket2 v0.3.181.3s0.6s (48%)
178.anyhow v1.0.351.3s0.7s (53%)default, std
179.httparse v1.3.41.3s0.5s (41%)default, std
180.net2 v0.2.371.3s0.6s (50%)default, duration
181.captcha v0.0.81.2s0.5s (37%)
182.memchr v2.3.41.2s0.5s (40%)default, std, use_std
183.crossbeam-epoch v0.9.11.2s0.5s (40%)alloc, lazy_static, std
184.tokio-util v0.3.11.2s0.4s (28%)codec, compat, default, full, futures-io, udp
185.version_check v0.1.51.2s0.8s (65%)
186.strsim v0.9.31.2s0.8s (62%)
187.background-jobs-actix v0.8.01.2s0.3s (27%)
188.indexmap v1.6.11.2s0.1s (12%)
189.uuid v0.8.11.2s0.2s (21%)default, rand, serde, std, v4
190.actix-connect v2.0.01.2s0.3s (27%)default, http, rust-tls, rustls, tokio-rustls, uri, webpki
191.hyperx v1.2.0 custom-build1.2s0.0s (0%)headers
192.ppv-lite86 v0.2.101.1s0.0s (1%)simd, std
193.ucd-trie v0.1.31.1s0.7s (62%)default, std
194.rgb v0.8.251.1s0.0s (4%)as-bytes, bytemuck, default
195.num-integer v0.1.441.1s0.3s (30%)i128, std
196.matches v0.1.81.1s0.0s (1%)
197.scheduled-thread-pool v0.2.51.1s0.7s (65%)
198.humantime v2.0.11.1s0.4s (40%)
199.pq-sys v0.4.6 custom-build1.1s0.0s (0%)
200.serde_urlencoded v0.7.01.1s0.1s (10%)
201.log v0.4.111.1s0.4s (36%)std
202.quote v1.0.71.1s0.5s (47%)default, proc-macro
203.const_fn v0.4.4 custom-build1.1s0.0s (0%)
204.parking_lot_core v0.8.11.0s0.5s (44%)
205.generic-array v0.14.41.0s0.0s (3%)
206.lemmy_rate_limit v0.1.01.0s0.2s (17%)
207.sha-1 v0.9.21.0s0.5s (45%)default, std
208.thread_local v1.0.11.0s0.4s (43%)
209.activitystreams-ext v0.1.0-alpha.21.0s0.1s (6%)
210.syn v1.0.54 custom-build1.0s0.0s (0%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
211.twoway v0.2.11.0s0.4s (41%)default, use_std
212.http-signature-normalization-reqwest v0.1.31.0s0.1s (14%)base64, digest, sha-2, sha2, tokio
213.libc v0.2.81 custom-build0.9s0.0s (0%)align, default, std
214.byteorder v1.3.40.9s0.2s (17%)default, std
215.serde_derive v1.0.118 custom-build0.9s0.0s (0%)default
216.serde v1.0.118 custom-build0.9s0.0s (0%)default, derive, serde_derive, std
217.color_quant v1.1.00.9s0.5s (58%)
218.hound v3.4.00.9s0.3s (29%)
219.proc-macro2 v1.0.24 custom-build0.9s0.0s (0%)default, proc-macro
220.httpdate v0.3.20.9s0.4s (42%)
221.anyhow v1.0.35 custom-build0.9s0.0s (0%)default, std
222.native-tls v0.2.60.9s0.3s (38%)
223.bcrypt v0.9.00.9s0.4s (44%)default, std
224.unicase v2.6.0 custom-build (run)0.9s0.0s (0%)
225.proc-macro-hack v0.5.19 custom-build0.8s0.0s (0%)
226.brotli2 v0.3.20.8s0.3s (33%)
227.maybe-uninit v2.0.0 custom-build0.8s0.0s (0%)
228.quoted_printable v0.4.20.8s0.4s (44%)
229.crc32fast v1.2.10.8s0.3s (38%)default, std
230.radium v0.5.3 custom-build0.8s0.0s (0%)
231.addr2line v0.14.00.8s0.2s (23%)
232.futures-channel v0.3.80.8s0.1s (14%)alloc, default, futures-sink, sink, std
233.getrandom v0.1.15 custom-build0.8s0.0s (0%)std
234.tracing v0.1.220.8s0.3s (39%)log, std
235.once_cell v1.5.20.8s0.2s (24%)alloc, default, std
236.lock_api v0.4.20.8s0.0s (4%)
237.futures-task v0.3.80.8s0.2s (20%)alloc, once_cell, std
238.entities v1.0.10.8s0.1s (18%)
239.unicase v2.6.00.8s0.3s (35%)
240.pq-sys v0.4.60.8s0.2s (31%)
241.heck v0.3.10.7s0.4s (52%)
242.iovec v0.1.40.7s0.3s (43%)
243.radium v0.5.30.7s0.1s (7%)
244.num-traits v0.2.14 custom-build (run)0.7s0.0s (0%)default, i128, std
245.log v0.4.11 custom-build0.7s0.0s (0%)std
246.standback v0.2.13 custom-build0.7s0.0s (0%)std
247.num-rational v0.3.2 custom-build (run)0.7s0.0s (0%)
248.event-listener v2.5.10.7s0.3s (48%)
249.memchr v2.3.4 custom-build0.7s0.0s (0%)default, std, use_std
250.spin v0.5.20.7s0.0s (2%)
251.ryu v1.0.50.7s0.2s (35%)
252.num-iter v0.1.42 custom-build (run)0.7s0.0s (0%)default, std
253.actix-tls v2.0.00.7s0.2s (31%)default, rust-tls, rustls, tokio-rustls, webpki, webpki-roots
254.rayon v1.5.0 custom-build (run)0.7s0.0s (0%)
255.migrations_internals v1.4.10.7s0.1s (19%)default
256.openssl v0.10.31 custom-build0.7s0.0s (0%)
257.rand_core v0.5.10.7s0.2s (25%)alloc, getrandom, std
258.r2d2 v0.8.90.7s0.1s (16%)
259.getrandom v0.2.0 custom-build0.7s0.0s (0%)std
260.futures-executor v0.3.80.7s0.2s (37%)std
261.getrandom v0.1.150.7s0.2s (35%)std
262.openssl-probe v0.1.20.7s0.3s (53%)
263.actix-codec v0.3.00.7s0.1s (11%)
264.getrandom v0.2.00.6s0.2s (34%)std
265.unicode_categories v0.1.10.6s0.1s (11%)
266.shell-words v1.0.00.6s0.3s (44%)
267.num-bigint v0.2.6 custom-build0.6s0.0s (0%)default, std
268.futures-io v0.3.80.6s0.3s (47%)default, std
269.indexmap v1.6.1 custom-build (run)0.6s0.0s (0%)
270.miniz_oxide v0.4.3 custom-build (run)0.6s0.0s (0%)no_extern_crate_alloc
271.time v0.2.23 custom-build0.6s0.0s (0%)libc, std, stdweb, winapi
272.sct v0.6.00.6s0.2s (32%)
273.num-bigint v0.2.6 custom-build (run)0.6s0.0s (0%)default, std
274.generic-array v0.14.4 custom-build0.6s0.0s (0%)
275.futures-core v0.3.80.6s0.2s (29%)alloc, default, std
276.form_urlencoded v1.0.00.6s0.2s (35%)
277.brotli-sys v0.3.2 custom-build0.6s0.0s (0%)
278.unicase v2.6.0 custom-build0.6s0.0s (0%)
279.crossbeam-deque v0.8.00.6s0.0s (5%)crossbeam-epoch, crossbeam-utils, default, std
280.either v1.6.10.6s0.0s (2%)default, use_std
281.linked-hash-map v0.5.30.6s0.0s (3%)
282.crossbeam-utils v0.8.1 custom-build0.6s0.0s (0%)default, lazy_static, std
283.mio-uds v0.6.80.6s0.2s (29%)
284.hostname v0.3.10.5s0.2s (44%)default
285.num-integer v0.1.44 custom-build0.5s0.0s (0%)i128, std
286.num-traits v0.2.14 custom-build0.5s0.0s (0%)default, i128, std
287.actix-testing v1.0.10.5s0.1s (19%)
288.tokio-rustls v0.14.10.5s0.0s (7%)
289.v_htmlescape v0.11.0 custom-build0.5s0.0s (0%)bytes-buf, default
290.native-tls v0.2.6 custom-build0.5s0.0s (0%)
291.slab v0.4.20.5s0.0s (3%)
292.blowfish v0.7.00.5s0.1s (18%)bcrypt
293.bytestring v0.1.50.5s0.1s (29%)
294.crossbeam-utils v0.7.2 custom-build0.5s0.0s (0%)default, lazy_static, std
295.rayon v1.5.0 custom-build0.5s0.0s (0%)
296.linked-hash-map v0.3.00.5s0.0s (4%)serde, serde_impl, serde_test
297.cipher v0.2.50.5s0.0s (4%)
298.miniz_oxide v0.4.3 custom-build0.5s0.0s (0%)no_extern_crate_alloc
299.wyz v0.2.00.5s0.0s (3%)alloc
300.untrusted v0.7.10.5s0.1s (11%)
301.openssl-sys v0.9.59 custom-build (run)0.5s0.0s (0%)
302.adler v0.2.30.5s0.1s (30%)
303.want v0.3.00.5s0.2s (32%)
304.nom v5.1.2 custom-build0.5s0.0s (0%)alloc, default, lexical, lexical-core, std
305.memoffset v0.6.1 custom-build0.5s0.0s (0%)default
306.actix-threadpool v0.3.30.5s0.2s (33%)
307.nom v6.0.1 custom-build0.5s0.0s (0%)alloc, bitvec
308.cookie v0.14.3 custom-build0.5s0.0s (0%)percent-encode, percent-encoding
309.indexmap v1.6.1 custom-build0.5s0.0s (0%)
310.num-iter v0.1.420.4s0.0s (3%)default, std
311.tokio v0.3.6 custom-build0.4s0.0s (0%)default, sync
312.thiserror v1.0.220.4s0.1s (28%)
313.num-rational v0.3.2 custom-build0.4s0.0s (0%)
314.tokio v0.3.6 custom-build (run)0.4s0.0s (0%)default, sync
315.tokio-tls v0.3.10.4s0.0s (9%)
316.adler32 v1.2.00.4s0.1s (33%)default, std
317.bytemuck v1.4.10.4s0.0s (9%)
318.memoffset v0.6.1 custom-build (run)0.4s0.0s (0%)default
319.standback v0.2.13 custom-build (run)0.4s0.0s (0%)std
320.num-iter v0.1.42 custom-build0.4s0.0s (0%)default, std
321.buf-min v0.2.00.4s0.0s (5%)bytes, bytes-buf
322.itoa v0.4.60.4s0.0s (5%)default, std
323.nom v4.2.3 custom-build0.4s0.0s (0%)alloc, default, std
324.derive_builder v0.9.0 custom-build0.4s0.0s (0%)
325.lexical-core v0.7.4 custom-build0.4s0.0s (0%)arrayvec, correct, default, ryu, static_assertions, std, table
326.rayon-core v1.9.0 custom-build0.4s0.0s (0%)
327.v_escape v0.14.1 custom-build0.4s0.0s (0%)bytes-buf
328.ident_case v1.0.10.4s0.1s (17%)
329.unchecked-index v0.2.20.4s0.0s (9%)
330.static_assertions v1.1.00.4s0.0s (4%)
331.http-body v0.3.10.4s0.0s (10%)
332.typed-arena v1.7.00.4s0.0s (4%)default, std
333.anyhow v1.0.35 custom-build (run)0.4s0.0s (0%)default, std
334.tracing-futures v0.2.40.4s0.0s (6%)pin-project, std-future
335.fxhash v0.2.10.4s0.1s (19%)
336.async-mutex v1.4.00.3s0.0s (7%)
337.unicode-xid v0.2.10.3s0.1s (19%)default
338.lru-cache v0.1.20.3s0.0s (3%)
339.digest v0.9.00.3s0.0s (7%)alloc, std
340.scopeguard v1.1.00.3s0.0s (9%)
341.lazy_static v1.4.00.3s0.0s (12%)
342.background-jobs v0.8.00.3s0.0s (4%)background-jobs-actix, default
343.futures v0.3.80.3s0.0s (7%)alloc, async-await, default, executor, futures-executor, std
344.strum v0.20.00.3s0.0s (10%)
345.block-buffer v0.9.00.3s0.0s (14%)
346.atty v0.2.140.3s0.0s (8%)
347.proc-macro-nested v0.1.60.3s0.0s (6%)
348.hyper-tls v0.4.30.3s0.0s (9%)
349.webpki-roots v0.20.00.3s0.0s (7%)
350.memoffset v0.6.10.3s0.0s (5%)default
351.darling v0.10.20.3s0.0s (6%)default, suggestions
352.tap v1.0.00.3s0.0s (6%)
353.cpuid-bool v0.1.20.3s0.0s (12%)
354.fnv v1.0.70.3s0.0s (5%)default, std
355.instant v0.1.90.3s0.0s (17%)
356.futures-sink v0.3.80.3s0.0s (5%)alloc, default, std
357.cookie v0.14.3 custom-build (run)0.3s0.0s (0%)percent-encode, percent-encoding
358.quick-error v1.2.30.3s0.0s (7%)
359.try-lock v0.2.30.3s0.0s (7%)
360.bitflags v1.2.10.3s0.0s (8%)default
361.tower-service v0.3.00.3s0.0s (4%)
362.pin-project v0.4.270.3s0.0s (5%)
363.match_cfg v0.1.00.2s0.0s (14%)default, use_core
364.copyless v0.1.50.2s0.0s (5%)
365.cfg-if v0.1.100.2s0.0s (8%)
366.num-traits v0.1.430.2s0.0s (4%)
367.pin-utils v0.1.00.2s0.0s (4%)
368.maybe-uninit v2.0.00.2s0.0s (6%)
369.nom v6.0.1 custom-build (run)0.2s0.0s (0%)alloc, bitvec
370.brotli-sys v0.3.20.2s0.0s (7%)
371.crc32fast v1.2.1 custom-build (run)0.2s0.0s (0%)default, std
372.standback v0.2.130.2s0.0s (8%)std
373.nom v4.2.3 custom-build (run)0.2s0.0s (0%)alloc, default, std
374.maplit v1.0.20.2s0.0s (5%)
375.foreign-types v0.3.20.2s0.0s (7%)
376.cfg-if v1.0.00.2s0.0s (8%)
377.serde_derive v1.0.118 custom-build (run)0.2s0.0s (0%)default
378.opaque-debug v0.3.00.2s0.0s (9%)
379.nom v5.1.2 custom-build (run)0.2s0.0s (0%)alloc, default, lexical, lexical-core, std
380.proc-macro2 v1.0.24 custom-build (run)0.2s0.0s (0%)default, proc-macro
381.tinyvec_macros v0.1.00.2s0.0s (7%)
382.foreign-types-shared v0.1.10.2s0.0s (9%)
383.pin-project-lite v0.1.110.2s0.0s (4%)
384.generic-array v0.14.4 custom-build (run)0.2s0.0s (0%)
385.serde v1.0.118 custom-build (run)0.2s0.0s (0%)default, derive, serde_derive, std
386.pin-project v1.0.20.2s0.0s (5%)
387.serde_json v1.0.60 custom-build (run)0.2s0.0s (0%)default, indexmap, preserve_order, std
388.time v0.2.23 custom-build (run)0.2s0.0s (0%)libc, std, stdweb, winapi
389.pin-project-internal v0.4.27 custom-build (run)0.2s0.0s (0%)
390.syn v1.0.54 custom-build (run)0.2s0.0s (0%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
391.v_escape v0.14.10.2s0.0s (5%)bytes-buf
392.const_fn v0.4.4 custom-build (run)0.2s0.0s (0%)
393.bitflags v1.2.1 custom-build (run)0.2s0.0s (0%)default
394.time-macros v0.1.10.2s0.0s (6%)
395.diesel_migrations v1.4.00.2s0.0s (4%)default
396.ryu v1.0.5 custom-build (run)0.2s0.0s (0%)
397.proc-macro-hack v0.5.19 custom-build (run)0.2s0.0s (0%)
398.byteorder v1.3.4 custom-build (run)0.2s0.0s (0%)default, std
399.pin-project-lite v0.2.00.2s0.0s (4%)
400.pq-sys v0.4.6 custom-build (run)0.2s0.0s (0%)
401.httparse v1.3.4 custom-build (run)0.2s0.0s (0%)default, std
402.libc v0.2.81 custom-build (run)0.2s0.0s (0%)align, default, std
403.maybe-uninit v2.0.0 custom-build (run)0.2s0.0s (0%)
404.hyperx v1.2.0 custom-build (run)0.1s0.0s (0%)headers
405.typenum v1.12.0 custom-build (run)0.1s0.0s (0%)
406.mime_guess v2.0.3 custom-build (run)0.1s0.0s (0%)default, rev-mappings
407.proc-macro-nested v0.1.6 custom-build (run)0.0s0.0s (0%)
408.encoding_rs v0.8.26 custom-build (run)0.0s0.0s (0%)
409.num-integer v0.1.44 custom-build (run)0.0s0.0s (0%)i128, std
410.radium v0.5.3 custom-build (run)0.0s0.0s (0%)
411.native-tls v0.2.6 custom-build (run)0.0s0.0s (0%)
412.v_htmlescape v0.11.0 custom-build (run)0.0s0.0s (0%)bytes-buf, default
413.memchr v2.3.4 custom-build (run)0.0s0.0s (1%)default, std, use_std
414.openssl v0.10.31 custom-build (run)0.0s0.0s (0%)
415.getrandom v0.1.15 custom-build (run)0.0s0.0s (0%)std
416.lexical-core v0.7.4 custom-build (run)0.0s0.0s (1%)arrayvec, correct, default, ryu, static_assertions, std, table
417.derive_builder v0.9.0 custom-build (run)0.0s0.0s (0%)
418.v_escape v0.14.1 custom-build (run)0.0s0.0s (0%)bytes-buf
419.log v0.4.11 custom-build (run)0.0s0.0s (1%)std
420.rayon-core v1.9.0 custom-build (run)0.0s0.0s (0%)
421.getrandom v0.2.0 custom-build (run)0.0s0.0s (1%)std
+ + + diff --git a/cargo-timing.html b/cargo-timing.html new file mode 100644 index 000000000..c14605108 --- /dev/null +++ b/cargo-timing.html @@ -0,0 +1,24104 @@ + + + + Cargo Build Timings — lemmy_server 0.0.1 + + + + + +

Cargo Build Timings

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Targets:lemmy_server 0.0.1 (lib, bin "lemmy_server")
Profile:dev
Fresh units:0
Dirty units:421
Total units:421
Max concurrency:12 (jobs=12 ncpu=12)
Build start:2020-12-19T14:19:46Z
Total time:191.9s (3m 11.9s)
rustc:rustc 1.50.0-nightly (825637983 2020-11-18)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency:0
+ + + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UnitTotalCodegenFeatures
1.lemmy_db v0.1.045.2s6.9s (15%)
2.diesel v1.4.523.2s0.6s (2%)32-column-tables, bitflags, chrono, default, postgres, pq-sys, r2d2, serde_json, with-deprecated
3.syn v1.0.5419.5s7.8s (40%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
4.h2 v0.2.718.6s8.8s (47%)
5.lemmy_server v0.0.118.4s13.2s (72%)
6.serde_derive v1.0.11816.5s0.0s (0%)default
7.lemmy_server v0.0.1 bin "lemmy_server"15.8s0.0s (0%)
8.diesel_derives v1.4.114.2s0.0s (0%)default, postgres
9.hyper v0.13.914.2s0.8s (6%)socket2, tcp
10.derive_more v0.99.1114.1s0.0s (0%)add, add_assign, as_mut, as_ref, constructor, default, deref, deref_mut, display, error, from, from_str, index, index_mut, into, into_iterator, iterator, mul, mul_assign, not, sum, try_into
11.activitystreams v0.7.0-alpha.813.3s2.7s (20%)
12.trust-dns-proto v0.19.612.9s8.6s (66%)tokio, tokio-runtime
13.regex-syntax v0.6.2112.8s5.0s (39%)default, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment
14.image v0.23.1212.6s5.5s (44%)bmp, dds, default, dxt, farbfeld, gif, hdr, ico, jpeg, jpeg_rayon, png, pnm, scoped_threadpool, tga, tiff, webp
15.lettre v0.10.0-alpha.412.4s1.6s (13%)base64, builder, default, file-transport, hostname, hyperx, mime, native-tls, nom, quoted_printable, r2d2, rand, sendmail-transport, serde, serde_json, smtp-transport
16.pin-project-internal v0.4.2712.2s0.0s (0%)
17.async-trait v0.1.4211.9s0.0s (0%)
18.regex v1.4.211.5s8.6s (75%)aho-corasick, default, memchr, perf, perf-cache, perf-dfa, perf-inline, perf-literal, std, thread_local, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment
19.thiserror-impl v1.0.2211.2s0.0s (0%)
20.trust-dns-resolver v0.19.611.0s2.8s (25%)ipconfig, resolv-conf, system-config, tokio, tokio-runtime
21.rayon v1.5.010.5s0.8s (8%)
22.object v0.22.010.4s4.3s (41%)archive, coff, elf, macho, pe, read_core, unaligned
23.lemmy_api v0.1.010.2s4.7s (46%)
24.lemmy_apub v0.1.010.2s4.3s (42%)
25.tokio v0.2.2410.1s2.9s (29%)blocking, default, fnv, futures-core, io-driver, io-util, iovec, lazy_static, libc, memchr, mio, mio-uds, rt-core, rt-util, signal, signal-hook-registry, slab, stream, sync, tcp, time, udp, uds, winapi
26.lemmy_db_schema v0.1.09.6s0.8s (9%)
27.rustls v0.18.19.2s3.7s (40%)dangerous_configuration, default, log, logging
28.strum_macros v0.20.19.2s0.0s (0%)
29.darling_macro v0.10.28.5s0.0s (0%)
30.comrak v0.9.08.3s3.9s (47%)
31.openssl v0.10.318.2s2.8s (34%)
32.brotli-sys v0.3.2 custom-build (run)8.2s0.0s (0%)
33.actix_derive v0.5.08.2s0.0s (0%)
34.encoding_rs v0.8.267.7s3.8s (49%)
35.darling_core v0.10.27.7s2.3s (30%)strsim, suggestions
36.gimli v0.23.07.6s1.3s (17%)read
37.pin-project-internal v1.0.27.6s0.0s (0%)
38.futures-util v0.3.87.4s0.3s (4%)alloc, async-await, async-await-macro, channel, default, futures-channel, futures-io, futures-macro, futures-sink, io, memchr, proc-macro-hack, proc-macro-nested, sink, slab, std
39.rand v0.7.37.3s0.9s (12%)alloc, default, getrandom, getrandom_package, libc, std
40.rayon-core v1.9.07.1s5.5s (78%)
41.pest_generator v2.1.37.1s1.6s (23%)
42.http v0.2.27.0s1.9s (27%)
43.serde v1.0.1186.8s0.7s (11%)default, derive, serde_derive, std
44.ring v0.16.196.7s3.6s (53%)alloc, default, dev_urandom_fallback, once_cell, std
45.pest_meta v2.1.36.6s4.9s (75%)
46.hyperx v1.2.06.3s3.2s (50%)headers
47.actix-web v3.3.26.1s1.5s (25%)compress, default, rust-tls, rustls
48.cc v1.0.665.9s3.9s (66%)
49.actix-http v2.2.05.7s1.0s (19%)actix-tls, brotli2, compress, default, flate2, rustls
50.nom v6.0.15.6s0.5s (9%)alloc, bitvec
51.nom v5.1.25.4s0.8s (14%)alloc, default, lexical, lexical-core, std
52.serde v0.8.235.3s0.3s (6%)default, std
53.reqwest v0.10.105.3s3.3s (62%)__tls, default, default-tls, hyper-tls, json, native-tls-crate, serde_json, tokio-tls
54.time v0.2.235.3s2.2s (42%)libc, std, stdweb, winapi
55.backtrace v0.3.555.1s4.0s (79%)addr2line, default, gimli-symbolize, miniz_oxide, object, std
56.bitvec v0.19.44.9s0.1s (1%)alloc
57.aho-corasick v0.7.154.9s2.7s (56%)default, std
58.ryu v1.0.5 custom-build4.8s0.0s (0%)
59.num-bigint v0.2.64.8s1.4s (30%)default, std
60.lemmy_structs v0.1.04.7s0.4s (8%)
61.lodepng v3.2.24.7s2.8s (59%)default, rust_backend
62.awc v2.0.34.5s3.0s (66%)compress, rust-tls, rustls
63.derive_builder v0.9.04.2s0.0s (0%)
64.tiff v0.6.14.2s2.8s (67%)
65.lexical-core v0.7.44.1s0.3s (7%)arrayvec, correct, default, ryu, static_assertions, std, table
66.actix-server v1.0.44.1s2.2s (52%)default
67.jpeg-decoder v0.1.204.0s2.1s (52%)rayon
68.serde_json v1.0.603.9s0.8s (21%)default, indexmap, preserve_order, std
69.serde-hjson v0.9.13.8s2.2s (59%)default, linked-hash-map, preserve_order
70.v_escape_derive v0.8.43.8s0.0s (0%)
71.futures-macro v0.3.83.7s0.0s (0%)
72.pest v2.1.33.5s0.5s (13%)
73.chrono v0.4.193.4s0.4s (13%)clock, default, libc, oldtime, serde, std, time, winapi
74.tokio v0.3.63.3s1.4s (41%)default, sync
75.rand_chacha v0.2.23.2s2.2s (69%)std
76.proc-macro-hack v0.5.193.1s0.0s (0%)
77.lemmy_utils v0.1.03.1s0.6s (21%)
78.mio v0.6.233.1s1.4s (45%)default, with-deprecated
79.typenum v1.12.0 custom-build3.0s0.0s (0%)
80.miniz_oxide v0.3.73.0s1.4s (48%)
81.proc-macro2 v1.0.243.0s1.6s (53%)default, proc-macro
82.actix v0.10.03.0s0.3s (9%)default, resolver, trust-dns-proto, trust-dns-resolver
83.ring v0.16.19 custom-build (run)3.0s0.0s (0%)alloc, default, dev_urandom_fallback, once_cell, std
84.config v0.10.13.0s1.5s (49%)hjson, serde-hjson
85.actix-web-codegen v0.4.03.0s0.0s (0%)
86.base64 v0.13.02.9s0.3s (12%)default, std
87.itertools v0.9.02.9s0.5s (17%)default, use_std
88.url v2.2.02.8s0.8s (30%)serde
89.pkg-config v0.3.192.8s1.2s (44%)
90.rss v1.9.02.8s0.7s (24%)builders, default, derive_builder
91.unicode-segmentation v1.7.12.7s0.3s (12%)
92.nom v4.2.32.7s1.0s (36%)alloc, default, std
93.bytes v0.5.62.7s0.5s (18%)default, std
94.httparse v1.3.4 custom-build2.6s0.0s (0%)default, std
95.unicode-normalization v0.1.162.6s0.4s (16%)default, std
96.time-macros-impl v0.1.12.6s0.0s (0%)
97.deflate v0.8.62.6s1.3s (52%)
98.idna v0.2.02.6s1.2s (45%)
99.env_logger v0.8.22.5s1.1s (45%)atty, default, humantime, regex, termcolor
100.png v0.16.82.5s1.1s (43%)default, deflate, png-encoding
101.num-rational v0.3.22.5s1.4s (56%)
102.sha2 v0.9.22.4s0.8s (32%)default, std
103.base64 v0.12.32.3s0.4s (15%)default, std
104.actix-router v0.2.52.3s0.7s (30%)default, http
105.language-tags v0.2.22.3s1.7s (74%)
106.miniz_oxide v0.4.32.3s1.2s (51%)no_extern_crate_alloc
107.mime_guess v2.0.3 custom-build2.3s0.0s (0%)default, rev-mappings
108.crc32fast v1.2.1 custom-build2.2s0.0s (0%)default, std
109.num-traits v0.2.142.2s0.2s (8%)default, i128, std
110.tinyvec v1.1.02.2s0.0s (1%)alloc, default, tinyvec_macros
111.mime v0.3.162.2s1.7s (78%)
112.funty v1.0.12.2s1.0s (47%)
113.ipnet v2.3.02.2s1.2s (54%)
114.v_htmlescape v0.11.02.1s0.6s (28%)bytes-buf, default
115.background-jobs-core v0.8.02.1s0.5s (22%)actix-rt, default, tokio, with-actix
116.tracing-core v0.1.172.1s1.0s (51%)lazy_static, std
117.bytes v0.6.02.1s0.6s (31%)default, std
118.lemmy_websocket v0.1.02.0s0.7s (36%)
119.bitflags v1.2.1 custom-build2.0s0.0s (0%)default
120.typenum v1.12.02.0s0.1s (3%)
121.actix-rt v1.1.12.0s1.1s (55%)
122.unicode-bidi v0.3.42.0s1.1s (57%)default
123.migrations_macros v1.4.22.0s0.0s (0%)default
124.libc v0.2.811.9s0.2s (10%)align, default, std
125.encoding_rs v0.8.26 custom-build1.9s0.0s (0%)
126.actix-files v0.4.11.9s0.6s (32%)
127.byteorder v1.3.4 custom-build1.9s0.0s (0%)default, std
128.proc-macro-nested v0.1.6 custom-build1.9s0.0s (0%)
129.derive_builder_core v0.9.01.9s1.0s (54%)
130.enum-as-inner v0.3.31.9s0.0s (0%)
131.percent-encoding v2.1.01.8s0.2s (13%)
132.scoped_threadpool v0.1.91.8s1.4s (78%)
133.actix-utils v2.0.01.8s0.5s (28%)
134.gif v0.11.11.8s0.7s (37%)default, raii_no_panic, std
135.serde_json v1.0.60 custom-build1.8s0.0s (0%)default, indexmap, preserve_order, std
136.smallvec v1.5.11.8s0.0s (3%)
137.crossbeam-channel v0.5.01.8s0.6s (33%)crossbeam-utils, default, std
138.pin-project-internal v0.4.27 custom-build1.8s0.0s (0%)
139.ring v0.16.19 custom-build1.7s0.0s (0%)alloc, default, dev_urandom_fallback, once_cell, std
140.crossbeam-channel v0.4.41.7s0.5s (30%)
141.signal-hook-registry v1.2.21.7s1.0s (56%)
142.quick-xml v0.17.21.7s0.7s (43%)default, encoding, encoding_rs
143.cookie v0.14.31.7s1.0s (61%)percent-encode, percent-encoding
144.const_fn v0.4.41.7s0.0s (0%)
145.actix-macros v0.1.31.7s0.0s (0%)
146.weezl v0.1.31.7s0.9s (54%)alloc, default, std
147.time v0.1.441.7s0.7s (43%)
148.http-signature-normalization v0.5.31.6s0.9s (57%)
149.mime_guess v2.0.31.6s0.4s (27%)default, rev-mappings
150.openssl-sys v0.9.59 custom-build1.6s0.0s (0%)
151.pem v0.8.21.6s1.1s (70%)
152.hashbrown v0.9.11.6s0.1s (3%)raw
153.openssl-sys v0.9.591.6s0.2s (11%)
154.jsonwebtoken v7.2.01.6s0.5s (34%)
155.webpki v0.21.41.6s0.7s (44%)default, std, trust_anchor_util
156.crossbeam-utils v0.8.1 custom-build (run)1.5s0.0s (0%)default, lazy_static, std
157.resolv-conf v0.7.01.5s0.8s (51%)hostname, system
158.http-signature-normalization-actix v0.4.11.5s0.4s (28%)base64, digest, sha-2, sha2
159.crossbeam-utils v0.7.2 custom-build (run)1.5s0.0s (0%)default, lazy_static, std
160.flate2 v1.0.191.5s0.4s (27%)default, miniz_oxide, rust_backend
161.crossbeam-utils v0.8.11.5s0.7s (47%)default, lazy_static, std
162.actix-service v1.0.61.5s0.0s (3%)
163.rustc-demangle v0.1.181.5s0.7s (49%)
164.autocfg v1.0.11.5s0.9s (63%)
165.crossbeam-utils v0.7.21.5s0.7s (45%)default, lazy_static, std
166.arrayvec v0.5.21.4s0.0s (2%)array-sizes-33-128, default, std
167.pest_derive v2.1.01.4s0.0s (0%)
168.simple_asn1 v0.4.11.4s0.7s (51%)
169.version_check v0.9.21.4s0.8s (57%)
170.serde_test v0.8.231.4s0.2s (11%)
171.xdg v2.2.01.4s0.8s (59%)
172.parking_lot v0.11.11.4s0.8s (58%)default
173.num_cpus v1.13.01.4s0.9s (63%)
174.threadpool v1.8.11.4s1.0s (73%)
175.actix-web-actors v3.0.01.3s0.5s (38%)
176.termcolor v1.1.21.3s0.6s (45%)
177.socket2 v0.3.181.3s0.6s (48%)
178.anyhow v1.0.351.3s0.7s (53%)default, std
179.httparse v1.3.41.3s0.5s (41%)default, std
180.net2 v0.2.371.3s0.6s (50%)default, duration
181.captcha v0.0.81.2s0.5s (37%)
182.memchr v2.3.41.2s0.5s (40%)default, std, use_std
183.crossbeam-epoch v0.9.11.2s0.5s (40%)alloc, lazy_static, std
184.tokio-util v0.3.11.2s0.4s (28%)codec, compat, default, full, futures-io, udp
185.version_check v0.1.51.2s0.8s (65%)
186.strsim v0.9.31.2s0.8s (62%)
187.background-jobs-actix v0.8.01.2s0.3s (27%)
188.indexmap v1.6.11.2s0.1s (12%)
189.uuid v0.8.11.2s0.2s (21%)default, rand, serde, std, v4
190.actix-connect v2.0.01.2s0.3s (27%)default, http, rust-tls, rustls, tokio-rustls, uri, webpki
191.hyperx v1.2.0 custom-build1.2s0.0s (0%)headers
192.ppv-lite86 v0.2.101.1s0.0s (1%)simd, std
193.ucd-trie v0.1.31.1s0.7s (62%)default, std
194.rgb v0.8.251.1s0.0s (4%)as-bytes, bytemuck, default
195.num-integer v0.1.441.1s0.3s (30%)i128, std
196.matches v0.1.81.1s0.0s (1%)
197.scheduled-thread-pool v0.2.51.1s0.7s (65%)
198.humantime v2.0.11.1s0.4s (40%)
199.pq-sys v0.4.6 custom-build1.1s0.0s (0%)
200.serde_urlencoded v0.7.01.1s0.1s (10%)
201.log v0.4.111.1s0.4s (36%)std
202.quote v1.0.71.1s0.5s (47%)default, proc-macro
203.const_fn v0.4.4 custom-build1.1s0.0s (0%)
204.parking_lot_core v0.8.11.0s0.5s (44%)
205.generic-array v0.14.41.0s0.0s (3%)
206.lemmy_rate_limit v0.1.01.0s0.2s (17%)
207.sha-1 v0.9.21.0s0.5s (45%)default, std
208.thread_local v1.0.11.0s0.4s (43%)
209.activitystreams-ext v0.1.0-alpha.21.0s0.1s (6%)
210.syn v1.0.54 custom-build1.0s0.0s (0%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
211.twoway v0.2.11.0s0.4s (41%)default, use_std
212.http-signature-normalization-reqwest v0.1.31.0s0.1s (14%)base64, digest, sha-2, sha2, tokio
213.libc v0.2.81 custom-build0.9s0.0s (0%)align, default, std
214.byteorder v1.3.40.9s0.2s (17%)default, std
215.serde_derive v1.0.118 custom-build0.9s0.0s (0%)default
216.serde v1.0.118 custom-build0.9s0.0s (0%)default, derive, serde_derive, std
217.color_quant v1.1.00.9s0.5s (58%)
218.hound v3.4.00.9s0.3s (29%)
219.proc-macro2 v1.0.24 custom-build0.9s0.0s (0%)default, proc-macro
220.httpdate v0.3.20.9s0.4s (42%)
221.anyhow v1.0.35 custom-build0.9s0.0s (0%)default, std
222.native-tls v0.2.60.9s0.3s (38%)
223.bcrypt v0.9.00.9s0.4s (44%)default, std
224.unicase v2.6.0 custom-build (run)0.9s0.0s (0%)
225.proc-macro-hack v0.5.19 custom-build0.8s0.0s (0%)
226.brotli2 v0.3.20.8s0.3s (33%)
227.maybe-uninit v2.0.0 custom-build0.8s0.0s (0%)
228.quoted_printable v0.4.20.8s0.4s (44%)
229.crc32fast v1.2.10.8s0.3s (38%)default, std
230.radium v0.5.3 custom-build0.8s0.0s (0%)
231.addr2line v0.14.00.8s0.2s (23%)
232.futures-channel v0.3.80.8s0.1s (14%)alloc, default, futures-sink, sink, std
233.getrandom v0.1.15 custom-build0.8s0.0s (0%)std
234.tracing v0.1.220.8s0.3s (39%)log, std
235.once_cell v1.5.20.8s0.2s (24%)alloc, default, std
236.lock_api v0.4.20.8s0.0s (4%)
237.futures-task v0.3.80.8s0.2s (20%)alloc, once_cell, std
238.entities v1.0.10.8s0.1s (18%)
239.unicase v2.6.00.8s0.3s (35%)
240.pq-sys v0.4.60.8s0.2s (31%)
241.heck v0.3.10.7s0.4s (52%)
242.iovec v0.1.40.7s0.3s (43%)
243.radium v0.5.30.7s0.1s (7%)
244.num-traits v0.2.14 custom-build (run)0.7s0.0s (0%)default, i128, std
245.log v0.4.11 custom-build0.7s0.0s (0%)std
246.standback v0.2.13 custom-build0.7s0.0s (0%)std
247.num-rational v0.3.2 custom-build (run)0.7s0.0s (0%)
248.event-listener v2.5.10.7s0.3s (48%)
249.memchr v2.3.4 custom-build0.7s0.0s (0%)default, std, use_std
250.spin v0.5.20.7s0.0s (2%)
251.ryu v1.0.50.7s0.2s (35%)
252.num-iter v0.1.42 custom-build (run)0.7s0.0s (0%)default, std
253.actix-tls v2.0.00.7s0.2s (31%)default, rust-tls, rustls, tokio-rustls, webpki, webpki-roots
254.rayon v1.5.0 custom-build (run)0.7s0.0s (0%)
255.migrations_internals v1.4.10.7s0.1s (19%)default
256.openssl v0.10.31 custom-build0.7s0.0s (0%)
257.rand_core v0.5.10.7s0.2s (25%)alloc, getrandom, std
258.r2d2 v0.8.90.7s0.1s (16%)
259.getrandom v0.2.0 custom-build0.7s0.0s (0%)std
260.futures-executor v0.3.80.7s0.2s (37%)std
261.getrandom v0.1.150.7s0.2s (35%)std
262.openssl-probe v0.1.20.7s0.3s (53%)
263.actix-codec v0.3.00.7s0.1s (11%)
264.getrandom v0.2.00.6s0.2s (34%)std
265.unicode_categories v0.1.10.6s0.1s (11%)
266.shell-words v1.0.00.6s0.3s (44%)
267.num-bigint v0.2.6 custom-build0.6s0.0s (0%)default, std
268.futures-io v0.3.80.6s0.3s (47%)default, std
269.indexmap v1.6.1 custom-build (run)0.6s0.0s (0%)
270.miniz_oxide v0.4.3 custom-build (run)0.6s0.0s (0%)no_extern_crate_alloc
271.time v0.2.23 custom-build0.6s0.0s (0%)libc, std, stdweb, winapi
272.sct v0.6.00.6s0.2s (32%)
273.num-bigint v0.2.6 custom-build (run)0.6s0.0s (0%)default, std
274.generic-array v0.14.4 custom-build0.6s0.0s (0%)
275.futures-core v0.3.80.6s0.2s (29%)alloc, default, std
276.form_urlencoded v1.0.00.6s0.2s (35%)
277.brotli-sys v0.3.2 custom-build0.6s0.0s (0%)
278.unicase v2.6.0 custom-build0.6s0.0s (0%)
279.crossbeam-deque v0.8.00.6s0.0s (5%)crossbeam-epoch, crossbeam-utils, default, std
280.either v1.6.10.6s0.0s (2%)default, use_std
281.linked-hash-map v0.5.30.6s0.0s (3%)
282.crossbeam-utils v0.8.1 custom-build0.6s0.0s (0%)default, lazy_static, std
283.mio-uds v0.6.80.6s0.2s (29%)
284.hostname v0.3.10.5s0.2s (44%)default
285.num-integer v0.1.44 custom-build0.5s0.0s (0%)i128, std
286.num-traits v0.2.14 custom-build0.5s0.0s (0%)default, i128, std
287.actix-testing v1.0.10.5s0.1s (19%)
288.tokio-rustls v0.14.10.5s0.0s (7%)
289.v_htmlescape v0.11.0 custom-build0.5s0.0s (0%)bytes-buf, default
290.native-tls v0.2.6 custom-build0.5s0.0s (0%)
291.slab v0.4.20.5s0.0s (3%)
292.blowfish v0.7.00.5s0.1s (18%)bcrypt
293.bytestring v0.1.50.5s0.1s (29%)
294.crossbeam-utils v0.7.2 custom-build0.5s0.0s (0%)default, lazy_static, std
295.rayon v1.5.0 custom-build0.5s0.0s (0%)
296.linked-hash-map v0.3.00.5s0.0s (4%)serde, serde_impl, serde_test
297.cipher v0.2.50.5s0.0s (4%)
298.miniz_oxide v0.4.3 custom-build0.5s0.0s (0%)no_extern_crate_alloc
299.wyz v0.2.00.5s0.0s (3%)alloc
300.untrusted v0.7.10.5s0.1s (11%)
301.openssl-sys v0.9.59 custom-build (run)0.5s0.0s (0%)
302.adler v0.2.30.5s0.1s (30%)
303.want v0.3.00.5s0.2s (32%)
304.nom v5.1.2 custom-build0.5s0.0s (0%)alloc, default, lexical, lexical-core, std
305.memoffset v0.6.1 custom-build0.5s0.0s (0%)default
306.actix-threadpool v0.3.30.5s0.2s (33%)
307.nom v6.0.1 custom-build0.5s0.0s (0%)alloc, bitvec
308.cookie v0.14.3 custom-build0.5s0.0s (0%)percent-encode, percent-encoding
309.indexmap v1.6.1 custom-build0.5s0.0s (0%)
310.num-iter v0.1.420.4s0.0s (3%)default, std
311.tokio v0.3.6 custom-build0.4s0.0s (0%)default, sync
312.thiserror v1.0.220.4s0.1s (28%)
313.num-rational v0.3.2 custom-build0.4s0.0s (0%)
314.tokio v0.3.6 custom-build (run)0.4s0.0s (0%)default, sync
315.tokio-tls v0.3.10.4s0.0s (9%)
316.adler32 v1.2.00.4s0.1s (33%)default, std
317.bytemuck v1.4.10.4s0.0s (9%)
318.memoffset v0.6.1 custom-build (run)0.4s0.0s (0%)default
319.standback v0.2.13 custom-build (run)0.4s0.0s (0%)std
320.num-iter v0.1.42 custom-build0.4s0.0s (0%)default, std
321.buf-min v0.2.00.4s0.0s (5%)bytes, bytes-buf
322.itoa v0.4.60.4s0.0s (5%)default, std
323.nom v4.2.3 custom-build0.4s0.0s (0%)alloc, default, std
324.derive_builder v0.9.0 custom-build0.4s0.0s (0%)
325.lexical-core v0.7.4 custom-build0.4s0.0s (0%)arrayvec, correct, default, ryu, static_assertions, std, table
326.rayon-core v1.9.0 custom-build0.4s0.0s (0%)
327.v_escape v0.14.1 custom-build0.4s0.0s (0%)bytes-buf
328.ident_case v1.0.10.4s0.1s (17%)
329.unchecked-index v0.2.20.4s0.0s (9%)
330.static_assertions v1.1.00.4s0.0s (4%)
331.http-body v0.3.10.4s0.0s (10%)
332.typed-arena v1.7.00.4s0.0s (4%)default, std
333.anyhow v1.0.35 custom-build (run)0.4s0.0s (0%)default, std
334.tracing-futures v0.2.40.4s0.0s (6%)pin-project, std-future
335.fxhash v0.2.10.4s0.1s (19%)
336.async-mutex v1.4.00.3s0.0s (7%)
337.unicode-xid v0.2.10.3s0.1s (19%)default
338.lru-cache v0.1.20.3s0.0s (3%)
339.digest v0.9.00.3s0.0s (7%)alloc, std
340.scopeguard v1.1.00.3s0.0s (9%)
341.lazy_static v1.4.00.3s0.0s (12%)
342.background-jobs v0.8.00.3s0.0s (4%)background-jobs-actix, default
343.futures v0.3.80.3s0.0s (7%)alloc, async-await, default, executor, futures-executor, std
344.strum v0.20.00.3s0.0s (10%)
345.block-buffer v0.9.00.3s0.0s (14%)
346.atty v0.2.140.3s0.0s (8%)
347.proc-macro-nested v0.1.60.3s0.0s (6%)
348.hyper-tls v0.4.30.3s0.0s (9%)
349.webpki-roots v0.20.00.3s0.0s (7%)
350.memoffset v0.6.10.3s0.0s (5%)default
351.darling v0.10.20.3s0.0s (6%)default, suggestions
352.tap v1.0.00.3s0.0s (6%)
353.cpuid-bool v0.1.20.3s0.0s (12%)
354.fnv v1.0.70.3s0.0s (5%)default, std
355.instant v0.1.90.3s0.0s (17%)
356.futures-sink v0.3.80.3s0.0s (5%)alloc, default, std
357.cookie v0.14.3 custom-build (run)0.3s0.0s (0%)percent-encode, percent-encoding
358.quick-error v1.2.30.3s0.0s (7%)
359.try-lock v0.2.30.3s0.0s (7%)
360.bitflags v1.2.10.3s0.0s (8%)default
361.tower-service v0.3.00.3s0.0s (4%)
362.pin-project v0.4.270.3s0.0s (5%)
363.match_cfg v0.1.00.2s0.0s (14%)default, use_core
364.copyless v0.1.50.2s0.0s (5%)
365.cfg-if v0.1.100.2s0.0s (8%)
366.num-traits v0.1.430.2s0.0s (4%)
367.pin-utils v0.1.00.2s0.0s (4%)
368.maybe-uninit v2.0.00.2s0.0s (6%)
369.nom v6.0.1 custom-build (run)0.2s0.0s (0%)alloc, bitvec
370.brotli-sys v0.3.20.2s0.0s (7%)
371.crc32fast v1.2.1 custom-build (run)0.2s0.0s (0%)default, std
372.standback v0.2.130.2s0.0s (8%)std
373.nom v4.2.3 custom-build (run)0.2s0.0s (0%)alloc, default, std
374.maplit v1.0.20.2s0.0s (5%)
375.foreign-types v0.3.20.2s0.0s (7%)
376.cfg-if v1.0.00.2s0.0s (8%)
377.serde_derive v1.0.118 custom-build (run)0.2s0.0s (0%)default
378.opaque-debug v0.3.00.2s0.0s (9%)
379.nom v5.1.2 custom-build (run)0.2s0.0s (0%)alloc, default, lexical, lexical-core, std
380.proc-macro2 v1.0.24 custom-build (run)0.2s0.0s (0%)default, proc-macro
381.tinyvec_macros v0.1.00.2s0.0s (7%)
382.foreign-types-shared v0.1.10.2s0.0s (9%)
383.pin-project-lite v0.1.110.2s0.0s (4%)
384.generic-array v0.14.4 custom-build (run)0.2s0.0s (0%)
385.serde v1.0.118 custom-build (run)0.2s0.0s (0%)default, derive, serde_derive, std
386.pin-project v1.0.20.2s0.0s (5%)
387.serde_json v1.0.60 custom-build (run)0.2s0.0s (0%)default, indexmap, preserve_order, std
388.time v0.2.23 custom-build (run)0.2s0.0s (0%)libc, std, stdweb, winapi
389.pin-project-internal v0.4.27 custom-build (run)0.2s0.0s (0%)
390.syn v1.0.54 custom-build (run)0.2s0.0s (0%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
391.v_escape v0.14.10.2s0.0s (5%)bytes-buf
392.const_fn v0.4.4 custom-build (run)0.2s0.0s (0%)
393.bitflags v1.2.1 custom-build (run)0.2s0.0s (0%)default
394.time-macros v0.1.10.2s0.0s (6%)
395.diesel_migrations v1.4.00.2s0.0s (4%)default
396.ryu v1.0.5 custom-build (run)0.2s0.0s (0%)
397.proc-macro-hack v0.5.19 custom-build (run)0.2s0.0s (0%)
398.byteorder v1.3.4 custom-build (run)0.2s0.0s (0%)default, std
399.pin-project-lite v0.2.00.2s0.0s (4%)
400.pq-sys v0.4.6 custom-build (run)0.2s0.0s (0%)
401.httparse v1.3.4 custom-build (run)0.2s0.0s (0%)default, std
402.libc v0.2.81 custom-build (run)0.2s0.0s (0%)align, default, std
403.maybe-uninit v2.0.0 custom-build (run)0.2s0.0s (0%)
404.hyperx v1.2.0 custom-build (run)0.1s0.0s (0%)headers
405.typenum v1.12.0 custom-build (run)0.1s0.0s (0%)
406.mime_guess v2.0.3 custom-build (run)0.1s0.0s (0%)default, rev-mappings
407.proc-macro-nested v0.1.6 custom-build (run)0.0s0.0s (0%)
408.encoding_rs v0.8.26 custom-build (run)0.0s0.0s (0%)
409.num-integer v0.1.44 custom-build (run)0.0s0.0s (0%)i128, std
410.radium v0.5.3 custom-build (run)0.0s0.0s (0%)
411.native-tls v0.2.6 custom-build (run)0.0s0.0s (0%)
412.v_htmlescape v0.11.0 custom-build (run)0.0s0.0s (0%)bytes-buf, default
413.memchr v2.3.4 custom-build (run)0.0s0.0s (1%)default, std, use_std
414.openssl v0.10.31 custom-build (run)0.0s0.0s (0%)
415.getrandom v0.1.15 custom-build (run)0.0s0.0s (0%)std
416.lexical-core v0.7.4 custom-build (run)0.0s0.0s (1%)arrayvec, correct, default, ryu, static_assertions, std, table
417.derive_builder v0.9.0 custom-build (run)0.0s0.0s (0%)
418.v_escape v0.14.1 custom-build (run)0.0s0.0s (0%)bytes-buf
419.log v0.4.11 custom-build (run)0.0s0.0s (1%)std
420.rayon-core v1.9.0 custom-build (run)0.0s0.0s (0%)
421.getrandom v0.2.0 custom-build (run)0.0s0.0s (1%)std
+ + + diff --git a/lemmy_api/src/community.rs b/lemmy_api/src/community.rs index 0316beaa3..3d13a7fb8 100644 --- a/lemmy_api/src/community.rs +++ b/lemmy_api/src/community.rs @@ -11,7 +11,13 @@ use anyhow::Context; use lemmy_apub::ActorType; use lemmy_db::{ diesel_option_overwrite, - source::{comment::Comment_, community::*, moderator::*, post::Post_, site::*}, + source::{ + comment::Comment_, + community::{CommunityModerator_, Community_}, + moderator::*, + post::Post_, + site::*, + }, views::{ comment_view::CommentQueryBuilder, community::{ @@ -30,7 +36,7 @@ use lemmy_db::{ }; use lemmy_db_schema::{ naive_now, - source::{comment::Comment, post::Post}, + source::{comment::Comment, community::*, post::Post}, }; use lemmy_structs::{blocking, community::*}; use lemmy_utils::{ diff --git a/lemmy_api/src/lib.rs b/lemmy_api/src/lib.rs index e6c3b8253..fc484c323 100644 --- a/lemmy_api/src/lib.rs +++ b/lemmy_api/src/lib.rs @@ -1,12 +1,16 @@ use crate::claims::Claims; use actix_web::{web, web::Data}; use lemmy_db::{ - source::community::{Community, CommunityModerator}, + source::community::{CommunityModerator_, Community_}, views::community::community_user_ban_view::CommunityUserBanView, Crud, DbPool, }; -use lemmy_db_schema::source::{post::Post, user::User_}; +use lemmy_db_schema::source::{ + community::{Community, CommunityModerator}, + post::Post, + user::User_, +}; use lemmy_structs::{blocking, comment::*, community::*, post::*, site::*, user::*}; use lemmy_utils::{settings::Settings, APIError, ConnectionId, LemmyError}; use lemmy_websocket::{serialize_websocket_message, LemmyContext, UserOperation}; diff --git a/lemmy_api/src/user.rs b/lemmy_api/src/user.rs index a6e1cbced..b1a92bbe5 100644 --- a/lemmy_api/src/user.rs +++ b/lemmy_api/src/user.rs @@ -18,7 +18,7 @@ use lemmy_db::{ diesel_option_overwrite, source::{ comment::Comment_, - community::*, + community::Community_, moderator::*, password_reset_request::*, post::Post_, @@ -49,7 +49,7 @@ use lemmy_db::{ }; use lemmy_db_schema::{ naive_now, - source::{comment::Comment, post::Post, user::*}, + source::{comment::Comment, community::*, post::Post, user::*}, }; use lemmy_structs::{blocking, send_email_to_user, user::*}; use lemmy_utils::{ diff --git a/lemmy_apub/src/activities/receive/community.rs b/lemmy_apub/src/activities/receive/community.rs index 534da5cb7..932917b1e 100644 --- a/lemmy_apub/src/activities/receive/community.rs +++ b/lemmy_apub/src/activities/receive/community.rs @@ -5,10 +5,11 @@ use activitystreams::{ }; use anyhow::Context; use lemmy_db::{ - source::community::Community, + source::community::Community_, views::community::community_view::CommunityView, ApubObject, }; +use lemmy_db_schema::source::community::Community; use lemmy_structs::{blocking, community::CommunityResponse}; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::{messages::SendCommunityRoomMessage, LemmyContext, UserOperation}; diff --git a/lemmy_apub/src/activities/send/comment.rs b/lemmy_apub/src/activities/send/comment.rs index fa39fd472..4ddd2d321 100644 --- a/lemmy_apub/src/activities/send/comment.rs +++ b/lemmy_apub/src/activities/send/comment.rs @@ -26,8 +26,8 @@ use activitystreams::{ }; use anyhow::anyhow; use itertools::Itertools; -use lemmy_db::{source::community::Community, Crud, DbPool}; -use lemmy_db_schema::source::{comment::Comment, post::Post, user::User_}; +use lemmy_db::{Crud, DbPool}; +use lemmy_db_schema::source::{comment::Comment, community::Community, post::Post, user::User_}; use lemmy_structs::{blocking, WebFingerResponse}; use lemmy_utils::{ request::{retry, RecvError}, diff --git a/lemmy_apub/src/activities/send/community.rs b/lemmy_apub/src/activities/send/community.rs index 96152fa0d..035a8dfed 100644 --- a/lemmy_apub/src/activities/send/community.rs +++ b/lemmy_apub/src/activities/send/community.rs @@ -23,11 +23,8 @@ use activitystreams::{ }; use anyhow::Context; use itertools::Itertools; -use lemmy_db::{ - source::community::Community, - views::community::community_follower_view::CommunityFollowerView, - DbPool, -}; +use lemmy_db::{views::community::community_follower_view::CommunityFollowerView, DbPool}; +use lemmy_db_schema::source::community::Community; use lemmy_structs::blocking; use lemmy_utils::{location_info, settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/activities/send/post.rs b/lemmy_apub/src/activities/send/post.rs index c79f79ac5..732a53c33 100644 --- a/lemmy_apub/src/activities/send/post.rs +++ b/lemmy_apub/src/activities/send/post.rs @@ -21,8 +21,8 @@ use activitystreams::{ prelude::*, public, }; -use lemmy_db::{source::community::Community, Crud}; -use lemmy_db_schema::source::{post::Post, user::User_}; +use lemmy_db::Crud; +use lemmy_db_schema::source::{community::Community, post::Post, user::User_}; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/activities/send/user.rs b/lemmy_apub/src/activities/send/user.rs index 8c01aff85..cad20e9d9 100644 --- a/lemmy_apub/src/activities/send/user.rs +++ b/lemmy_apub/src/activities/send/user.rs @@ -13,13 +13,11 @@ use activitystreams::{ base::{AnyBase, BaseExt, ExtendsExt}, object::ObjectExt, }; -use lemmy_db::{ - source::community::{Community, CommunityFollower, CommunityFollowerForm}, - ApubObject, - DbPool, - Followable, +use lemmy_db::{ApubObject, DbPool, Followable}; +use lemmy_db_schema::source::{ + community::{Community, CommunityFollower, CommunityFollowerForm}, + user::User_, }; -use lemmy_db_schema::source::user::User_; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/activity_queue.rs b/lemmy_apub/src/activity_queue.rs index b32a3eb67..597c182b7 100644 --- a/lemmy_apub/src/activity_queue.rs +++ b/lemmy_apub/src/activity_queue.rs @@ -19,8 +19,8 @@ use background_jobs::{ WorkerConfig, }; use itertools::Itertools; -use lemmy_db::{source::community::Community, DbPool}; -use lemmy_db_schema::source::user::User_; +use lemmy_db::DbPool; +use lemmy_db_schema::source::{community::Community, user::User_}; use lemmy_utils::{location_info, settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; use log::{debug, warn}; diff --git a/lemmy_apub/src/fetcher.rs b/lemmy_apub/src/fetcher.rs index a4c5d66fc..608302fab 100644 --- a/lemmy_apub/src/fetcher.rs +++ b/lemmy_apub/src/fetcher.rs @@ -13,10 +13,7 @@ use anyhow::{anyhow, Context}; use chrono::NaiveDateTime; use diesel::result::Error::NotFound; use lemmy_db::{ - source::{ - community::{Community, CommunityModerator, CommunityModeratorForm}, - user::User, - }, + source::user::User, views::{ comment_view::CommentView, community::community_view::CommunityView, @@ -30,7 +27,12 @@ use lemmy_db::{ }; use lemmy_db_schema::{ naive_now, - source::{comment::Comment, post::Post, user::User_}, + source::{ + comment::Comment, + community::{Community, CommunityModerator, CommunityModeratorForm}, + post::Post, + user::User_, + }, }; use lemmy_structs::{blocking, site::SearchResponse}; use lemmy_utils::{ diff --git a/lemmy_apub/src/http/community.rs b/lemmy_apub/src/http/community.rs index 0ab14e070..45c576d24 100644 --- a/lemmy_apub/src/http/community.rs +++ b/lemmy_apub/src/http/community.rs @@ -10,10 +10,10 @@ use activitystreams::{ }; use actix_web::{body::Body, web, HttpResponse}; use lemmy_db::{ - source::{community::Community, post::Post_}, + source::{community::Community_, post::Post_}, views::community::community_follower_view::CommunityFollowerView, }; -use lemmy_db_schema::source::post::Post; +use lemmy_db_schema::source::{community::Community, post::Post}; use lemmy_structs::blocking; use lemmy_utils::LemmyError; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/inbox/community_inbox.rs b/lemmy_apub/src/inbox/community_inbox.rs index 9d5d4d1b7..0573b589f 100644 --- a/lemmy_apub/src/inbox/community_inbox.rs +++ b/lemmy_apub/src/inbox/community_inbox.rs @@ -27,13 +27,16 @@ use activitystreams::{ use actix_web::{web, HttpRequest, HttpResponse}; use anyhow::{anyhow, Context}; use lemmy_db::{ - source::community::{Community, CommunityFollower, CommunityFollowerForm}, + source::community::Community_, views::community::community_user_ban_view::CommunityUserBanView, ApubObject, DbPool, Followable, }; -use lemmy_db_schema::source::user::User_; +use lemmy_db_schema::source::{ + community::{Community, CommunityFollower, CommunityFollowerForm}, + user::User_, +}; use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/inbox/mod.rs b/lemmy_apub/src/inbox/mod.rs index 2d0977724..ae48ff074 100644 --- a/lemmy_apub/src/inbox/mod.rs +++ b/lemmy_apub/src/inbox/mod.rs @@ -12,12 +12,8 @@ use activitystreams::{ }; use actix_web::HttpRequest; use anyhow::{anyhow, Context}; -use lemmy_db::{ - source::{activity::Activity, community::Community}, - ApubObject, - DbPool, -}; -use lemmy_db_schema::source::user::User_; +use lemmy_db::{source::activity::Activity, ApubObject, DbPool}; +use lemmy_db_schema::source::{community::Community, user::User_}; use lemmy_structs::blocking; use lemmy_utils::{location_info, settings::Settings, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/inbox/shared_inbox.rs b/lemmy_apub/src/inbox/shared_inbox.rs index d94c54f25..d6c08a310 100644 --- a/lemmy_apub/src/inbox/shared_inbox.rs +++ b/lemmy_apub/src/inbox/shared_inbox.rs @@ -15,7 +15,8 @@ use crate::{ use activitystreams::{activity::ActorAndObject, prelude::*}; use actix_web::{web, HttpRequest, HttpResponse}; use anyhow::Context; -use lemmy_db::{source::community::Community, ApubObject, DbPool}; +use lemmy_db::{ApubObject, DbPool}; +use lemmy_db_schema::source::community::Community; use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/inbox/user_inbox.rs b/lemmy_apub/src/inbox/user_inbox.rs index d9feffd38..1b1a9d95f 100644 --- a/lemmy_apub/src/inbox/user_inbox.rs +++ b/lemmy_apub/src/inbox/user_inbox.rs @@ -49,15 +49,14 @@ use actix_web::{web, HttpRequest, HttpResponse}; use anyhow::{anyhow, Context}; use diesel::NotFound; use lemmy_db::{ - source::{ - community::{Community, CommunityFollower}, - private_message::PrivateMessage, - user::User, - }, + source::{private_message::PrivateMessage, user::User}, ApubObject, Followable, }; -use lemmy_db_schema::source::user::User_; +use lemmy_db_schema::source::{ + community::{Community, CommunityFollower}, + user::User_, +}; use lemmy_structs::blocking; use lemmy_utils::{location_info, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/lemmy_apub/src/objects/comment.rs b/lemmy_apub/src/objects/comment.rs index a753c8dbe..d3341630a 100644 --- a/lemmy_apub/src/objects/comment.rs +++ b/lemmy_apub/src/objects/comment.rs @@ -23,9 +23,10 @@ use activitystreams::{ prelude::*, }; use anyhow::{anyhow, Context}; -use lemmy_db::{source::community::Community, Crud, DbPool}; +use lemmy_db::{Crud, DbPool}; use lemmy_db_schema::source::{ comment::{Comment, CommentForm}, + community::Community, post::Post, user::User_, }; diff --git a/lemmy_apub/src/objects/community.rs b/lemmy_apub/src/objects/community.rs index f5fa2c318..b408f7737 100644 --- a/lemmy_apub/src/objects/community.rs +++ b/lemmy_apub/src/objects/community.rs @@ -22,12 +22,11 @@ use activitystreams::{ }; use activitystreams_ext::Ext2; use anyhow::Context; -use lemmy_db::{ +use lemmy_db::{views::community::community_moderator_view::CommunityModeratorView, DbPool}; +use lemmy_db_schema::{ + naive_now, source::community::{Community, CommunityForm}, - views::community::community_moderator_view::CommunityModeratorView, - DbPool, }; -use lemmy_db_schema::naive_now; use lemmy_structs::blocking; use lemmy_utils::{ location_info, diff --git a/lemmy_apub/src/objects/post.rs b/lemmy_apub/src/objects/post.rs index ed5a5d9ca..499ac8020 100644 --- a/lemmy_apub/src/objects/post.rs +++ b/lemmy_apub/src/objects/post.rs @@ -20,8 +20,9 @@ use activitystreams::{ }; use activitystreams_ext::Ext1; use anyhow::Context; -use lemmy_db::{source::community::Community, Crud, DbPool}; +use lemmy_db::{Crud, DbPool}; use lemmy_db_schema::source::{ + community::Community, post::{Post, PostForm}, user::User_, }; diff --git a/lemmy_db/src/aggregates/community_aggregates.rs b/lemmy_db/src/aggregates/community_aggregates.rs index f452892db..229652f00 100644 --- a/lemmy_db/src/aggregates/community_aggregates.rs +++ b/lemmy_db/src/aggregates/community_aggregates.rs @@ -24,7 +24,6 @@ impl CommunityAggregates { mod tests { use crate::{ aggregates::community_aggregates::CommunityAggregates, - source::community::{Community, CommunityFollower, CommunityFollowerForm, CommunityForm}, tests::establish_unpooled_connection, Crud, Followable, @@ -33,6 +32,7 @@ mod tests { }; use lemmy_db_schema::source::{ comment::{Comment, CommentForm}, + community::{Community, CommunityFollower, CommunityFollowerForm, CommunityForm}, post::{Post, PostForm}, user::{UserForm, User_}, }; diff --git a/lemmy_db/src/aggregates/post_aggregates.rs b/lemmy_db/src/aggregates/post_aggregates.rs index 434e52fd9..01082ca06 100644 --- a/lemmy_db/src/aggregates/post_aggregates.rs +++ b/lemmy_db/src/aggregates/post_aggregates.rs @@ -26,7 +26,6 @@ impl PostAggregates { mod tests { use crate::{ aggregates::post_aggregates::PostAggregates, - source::community::{Community, CommunityForm}, tests::establish_unpooled_connection, Crud, Likeable, @@ -35,6 +34,7 @@ mod tests { }; use lemmy_db_schema::source::{ comment::{Comment, CommentForm}, + community::{Community, CommunityForm}, post::{Post, PostForm, PostLike, PostLikeForm}, user::{UserForm, User_}, }; diff --git a/lemmy_db/src/aggregates/site_aggregates.rs b/lemmy_db/src/aggregates/site_aggregates.rs index 7fafc8eff..52890d814 100644 --- a/lemmy_db/src/aggregates/site_aggregates.rs +++ b/lemmy_db/src/aggregates/site_aggregates.rs @@ -22,7 +22,6 @@ impl SiteAggregates { mod tests { use crate::{ aggregates::site_aggregates::SiteAggregates, - source::community::{Community, CommunityForm}, tests::establish_unpooled_connection, Crud, ListingType, @@ -30,6 +29,7 @@ mod tests { }; use lemmy_db_schema::source::{ comment::{Comment, CommentForm}, + community::{Community, CommunityForm}, post::{Post, PostForm}, user::{UserForm, User_}, }; diff --git a/lemmy_db/src/aggregates/user_aggregates.rs b/lemmy_db/src/aggregates/user_aggregates.rs index 61a1ae7cc..e8981fd62 100644 --- a/lemmy_db/src/aggregates/user_aggregates.rs +++ b/lemmy_db/src/aggregates/user_aggregates.rs @@ -25,7 +25,6 @@ impl UserAggregates { mod tests { use crate::{ aggregates::user_aggregates::UserAggregates, - source::community::{Community, CommunityForm}, tests::establish_unpooled_connection, Crud, Likeable, @@ -34,6 +33,7 @@ mod tests { }; use lemmy_db_schema::source::{ comment::{Comment, CommentForm, CommentLike, CommentLikeForm}, + community::{Community, CommunityForm}, post::{Post, PostForm, PostLike, PostLikeForm}, user::{UserForm, User_}, }; diff --git a/lemmy_db/src/source/comment.rs b/lemmy_db/src/source/comment.rs index 010ca7da8..d70d7b699 100644 --- a/lemmy_db/src/source/comment.rs +++ b/lemmy_db/src/source/comment.rs @@ -205,7 +205,6 @@ impl Saveable for CommentSaved { #[cfg(test)] mod tests { use crate::{ - source::community::*, tests::establish_unpooled_connection, Crud, Likeable, @@ -215,6 +214,7 @@ mod tests { }; use lemmy_db_schema::source::{ comment::*, + community::{Community, CommunityForm}, post::*, user::{UserForm, User_}, }; diff --git a/lemmy_db/src/source/community.rs b/lemmy_db/src/source/community.rs index 795ed1232..9a30ca4cd 100644 --- a/lemmy_db/src/source/community.rs +++ b/lemmy_db/src/source/community.rs @@ -9,57 +9,22 @@ use crate::{ use diesel::{dsl::*, result::Error, *}; use lemmy_db_schema::{ naive_now, - schema::{community, community_follower, community_moderator, community_user_ban}, + source::community::{ + Community, + CommunityFollower, + CommunityFollowerForm, + CommunityForm, + CommunityModerator, + CommunityModeratorForm, + CommunityUserBan, + CommunityUserBanForm, + }, }; -use serde::Serialize; - -#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] -#[table_name = "community"] -pub struct Community { - pub id: i32, - pub name: String, - pub title: String, - pub description: Option, - pub category_id: i32, - pub creator_id: i32, - pub removed: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, - pub deleted: bool, - pub nsfw: bool, - pub actor_id: String, - pub local: bool, - pub private_key: Option, - pub public_key: Option, - pub last_refreshed_at: chrono::NaiveDateTime, - pub icon: Option, - pub banner: Option, -} - -/// A safe representation of community, without the sensitive info -#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] -#[table_name = "community"] -pub struct CommunitySafe { - pub id: i32, - pub name: String, - pub title: String, - pub description: Option, - pub category_id: i32, - pub creator_id: i32, - pub removed: bool, - pub published: chrono::NaiveDateTime, - pub updated: Option, - pub deleted: bool, - pub nsfw: bool, - pub actor_id: String, - pub local: bool, - pub icon: Option, - pub banner: Option, -} mod safe_type { use crate::{source::community::Community, ToSafe}; - use lemmy_db_schema::schema::community::columns::*; + use lemmy_db_schema::schema::community::*; + type Columns = ( id, name, @@ -102,28 +67,6 @@ mod safe_type { } } -#[derive(Insertable, AsChangeset, Debug)] -#[table_name = "community"] -pub struct CommunityForm { - pub name: String, - pub title: String, - pub description: Option, - pub category_id: i32, - pub creator_id: i32, - pub removed: Option, - pub published: Option, - pub updated: Option, - pub deleted: Option, - pub nsfw: bool, - pub actor_id: Option, - pub local: bool, - pub private_key: Option, - pub public_key: Option, - pub last_refreshed_at: Option, - pub icon: Option>, - pub banner: Option>, -} - impl Crud for Community { fn read(conn: &PgConnection, community_id: i32) -> Result { use lemmy_db_schema::schema::community::dsl::*; @@ -173,8 +116,35 @@ impl ApubObject for Community { } } -impl Community { - pub fn read_from_name(conn: &PgConnection, community_name: &str) -> Result { +pub trait Community_ { + fn read_from_name(conn: &PgConnection, community_name: &str) -> Result; + fn update_deleted( + conn: &PgConnection, + community_id: i32, + new_deleted: bool, + ) -> Result; + fn update_removed( + conn: &PgConnection, + community_id: i32, + new_removed: bool, + ) -> Result; + fn update_removed_for_creator( + conn: &PgConnection, + for_creator_id: i32, + new_removed: bool, + ) -> Result, Error>; + fn update_creator( + conn: &PgConnection, + community_id: i32, + new_creator_id: i32, + ) -> Result; + fn community_mods_and_admins(conn: &PgConnection, community_id: i32) -> Result, Error>; + fn distinct_federated_communities(conn: &PgConnection) -> Result, Error>; + fn is_mod_or_admin(conn: &PgConnection, user_id: i32, community_id: i32) -> bool; +} + +impl Community_ for Community { + fn read_from_name(conn: &PgConnection, community_name: &str) -> Result { use lemmy_db_schema::schema::community::dsl::*; community .filter(local.eq(true)) @@ -182,44 +152,44 @@ impl Community { .first::(conn) } - pub fn update_deleted( + fn update_deleted( conn: &PgConnection, community_id: i32, new_deleted: bool, - ) -> Result { + ) -> Result { use lemmy_db_schema::schema::community::dsl::*; diesel::update(community.find(community_id)) .set((deleted.eq(new_deleted), updated.eq(naive_now()))) .get_result::(conn) } - pub fn update_removed( + fn update_removed( conn: &PgConnection, community_id: i32, new_removed: bool, - ) -> Result { + ) -> Result { use lemmy_db_schema::schema::community::dsl::*; diesel::update(community.find(community_id)) .set((removed.eq(new_removed), updated.eq(naive_now()))) .get_result::(conn) } - pub fn update_removed_for_creator( + fn update_removed_for_creator( conn: &PgConnection, for_creator_id: i32, new_removed: bool, - ) -> Result, Error> { + ) -> Result, Error> { use lemmy_db_schema::schema::community::dsl::*; diesel::update(community.filter(creator_id.eq(for_creator_id))) .set((removed.eq(new_removed), updated.eq(naive_now()))) .get_results::(conn) } - pub fn update_creator( + fn update_creator( conn: &PgConnection, community_id: i32, new_creator_id: i32, - ) -> Result { + ) -> Result { use lemmy_db_schema::schema::community::dsl::*; diesel::update(community.find(community_id)) .set((creator_id.eq(new_creator_id), updated.eq(naive_now()))) @@ -237,35 +207,18 @@ impl Community { Ok(mods_and_admins) } - pub fn distinct_federated_communities(conn: &PgConnection) -> Result, Error> { + fn distinct_federated_communities(conn: &PgConnection) -> Result, Error> { use lemmy_db_schema::schema::community::dsl::*; community.select(actor_id).distinct().load::(conn) } - pub fn is_mod_or_admin(conn: &PgConnection, user_id: i32, community_id: i32) -> bool { + fn is_mod_or_admin(conn: &PgConnection, user_id: i32, community_id: i32) -> bool { Self::community_mods_and_admins(conn, community_id) .unwrap_or_default() .contains(&user_id) } } -#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] -#[belongs_to(Community)] -#[table_name = "community_moderator"] -pub struct CommunityModerator { - pub id: i32, - pub community_id: i32, - pub user_id: i32, - pub published: chrono::NaiveDateTime, -} - -#[derive(Insertable, AsChangeset, Clone)] -#[table_name = "community_moderator"] -pub struct CommunityModeratorForm { - pub community_id: i32, - pub user_id: i32, -} - impl Joinable for CommunityModerator { fn join( conn: &PgConnection, @@ -291,13 +244,21 @@ impl Joinable for CommunityModerator { } } -impl CommunityModerator { - pub fn delete_for_community(conn: &PgConnection, for_community_id: i32) -> Result { +pub trait CommunityModerator_ { + fn delete_for_community(conn: &PgConnection, for_community_id: i32) -> Result; + fn get_user_moderated_communities( + conn: &PgConnection, + for_user_id: i32, + ) -> Result, Error>; +} + +impl CommunityModerator_ for CommunityModerator { + fn delete_for_community(conn: &PgConnection, for_community_id: i32) -> Result { use lemmy_db_schema::schema::community_moderator::dsl::*; diesel::delete(community_moderator.filter(community_id.eq(for_community_id))).execute(conn) } - pub fn get_user_moderated_communities( + fn get_user_moderated_communities( conn: &PgConnection, for_user_id: i32, ) -> Result, Error> { @@ -309,23 +270,6 @@ impl CommunityModerator { } } -#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] -#[belongs_to(Community)] -#[table_name = "community_user_ban"] -pub struct CommunityUserBan { - pub id: i32, - pub community_id: i32, - pub user_id: i32, - pub published: chrono::NaiveDateTime, -} - -#[derive(Insertable, AsChangeset, Clone)] -#[table_name = "community_user_ban"] -pub struct CommunityUserBanForm { - pub community_id: i32, - pub user_id: i32, -} - impl Bannable for CommunityUserBan { fn ban( conn: &PgConnection, @@ -351,25 +295,6 @@ impl Bannable for CommunityUserBan { } } -#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] -#[belongs_to(Community)] -#[table_name = "community_follower"] -pub struct CommunityFollower { - pub id: i32, - pub community_id: i32, - pub user_id: i32, - pub published: chrono::NaiveDateTime, - pub pending: Option, -} - -#[derive(Insertable, AsChangeset, Clone)] -#[table_name = "community_follower"] -pub struct CommunityFollowerForm { - pub community_id: i32, - pub user_id: i32, - pub pending: bool, -} - impl Followable for CommunityFollower { fn follow( conn: &PgConnection, @@ -421,8 +346,16 @@ impl Followable for CommunityFollower { #[cfg(test)] mod tests { - use crate::{source::community::*, tests::establish_unpooled_connection, ListingType, SortType}; - use lemmy_db_schema::source::user::*; + use crate::{ + tests::establish_unpooled_connection, + Bannable, + Crud, + Followable, + Joinable, + ListingType, + SortType, + }; + use lemmy_db_schema::source::{community::*, user::*}; #[test] fn test_crud() { diff --git a/lemmy_db/src/source/moderator.rs b/lemmy_db/src/source/moderator.rs index ddb1407dc..dbe4fd18d 100644 --- a/lemmy_db/src/source/moderator.rs +++ b/lemmy_db/src/source/moderator.rs @@ -391,12 +391,13 @@ impl Crud for ModAdd { #[cfg(test)] mod tests { use crate::{ - source::{community::*, moderator::*}, + source::moderator::*, tests::establish_unpooled_connection, + Crud, ListingType, SortType, }; - use lemmy_db_schema::source::{comment::*, post::*, user::*}; + use lemmy_db_schema::source::{comment::*, community::*, post::*, user::*}; // use Crud; #[test] diff --git a/lemmy_db/src/source/post.rs b/lemmy_db/src/source/post.rs index 688ef39f3..81f09e722 100644 --- a/lemmy_db/src/source/post.rs +++ b/lemmy_db/src/source/post.rs @@ -231,13 +231,11 @@ impl Readable for PostRead { #[cfg(test)] mod tests { - use crate::{ - source::{community::*, post::*}, - tests::establish_unpooled_connection, - ListingType, - SortType, + use crate::{source::post::*, tests::establish_unpooled_connection, ListingType, SortType}; + use lemmy_db_schema::source::{ + community::{Community, CommunityForm}, + user::*, }; - use lemmy_db_schema::source::user::*; #[test] fn test_crud() { diff --git a/lemmy_db/src/source/user_mention.rs b/lemmy_db/src/source/user_mention.rs index 64e24d32b..b518cc891 100644 --- a/lemmy_db/src/source/user_mention.rs +++ b/lemmy_db/src/source/user_mention.rs @@ -79,12 +79,18 @@ impl UserMention { #[cfg(test)] mod tests { use crate::{ - source::{community::*, user_mention::*}, + source::user_mention::*, tests::establish_unpooled_connection, + Crud, ListingType, SortType, }; - use lemmy_db_schema::source::{comment::*, post::*, user::*}; + use lemmy_db_schema::source::{ + comment::*, + community::{Community, CommunityForm}, + post::*, + user::*, + }; #[test] fn test_crud() { diff --git a/lemmy_db/src/views/comment_report_view.rs b/lemmy_db/src/views/comment_report_view.rs index 0bfd6fe8d..7709f8fdb 100644 --- a/lemmy_db/src/views/comment_report_view.rs +++ b/lemmy_db/src/views/comment_report_view.rs @@ -1,9 +1,6 @@ use crate::{ limit_and_offset, - source::{ - comment_report::CommentReport, - community::{Community, CommunitySafe}, - }, + source::comment_report::CommentReport, views::ViewToVec, MaybeOptional, ToSafe, @@ -13,6 +10,7 @@ use lemmy_db_schema::{ schema::{comment, comment_report, community, post, user_, user_alias_1, user_alias_2}, source::{ comment::Comment, + community::{Community, CommunitySafe}, post::Post, user::{UserAlias1, UserAlias2, UserSafe, UserSafeAlias1, UserSafeAlias2, User_}, }, diff --git a/lemmy_db/src/views/comment_view.rs b/lemmy_db/src/views/comment_view.rs index 3628b5838..7b1d0bc61 100644 --- a/lemmy_db/src/views/comment_view.rs +++ b/lemmy_db/src/views/comment_view.rs @@ -3,7 +3,6 @@ use crate::{ functions::hot_rank, fuzzy_search, limit_and_offset, - source::community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, views::ViewToVec, ListingType, MaybeOptional, @@ -27,6 +26,7 @@ use lemmy_db_schema::{ }, source::{ comment::{Comment, CommentAlias1, CommentSaved}, + community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, post::Post, user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, }, @@ -409,15 +409,8 @@ impl ViewToVec for CommentView { #[cfg(test)] mod tests { - use crate::{ - source::community::*, - tests::establish_unpooled_connection, - views::comment_view::*, - Crud, - Likeable, - *, - }; - use lemmy_db_schema::source::{comment::*, post::*, user::*}; + use crate::{tests::establish_unpooled_connection, views::comment_view::*, Crud, Likeable, *}; + use lemmy_db_schema::source::{comment::*, community::*, post::*, user::*}; #[test] fn test_crud() { diff --git a/lemmy_db/src/views/community/community_follower_view.rs b/lemmy_db/src/views/community/community_follower_view.rs index 144481ce1..e7ba0e4a6 100644 --- a/lemmy_db/src/views/community/community_follower_view.rs +++ b/lemmy_db/src/views/community/community_follower_view.rs @@ -1,12 +1,11 @@ -use crate::{ - source::community::{Community, CommunitySafe}, - views::ViewToVec, - ToSafe, -}; +use crate::{views::ViewToVec, ToSafe}; use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, community_follower, user_}, - source::user::{UserSafe, User_}, + source::{ + community::{Community, CommunitySafe}, + user::{UserSafe, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/community/community_moderator_view.rs b/lemmy_db/src/views/community/community_moderator_view.rs index ffd2f6229..6800853ea 100644 --- a/lemmy_db/src/views/community/community_moderator_view.rs +++ b/lemmy_db/src/views/community/community_moderator_view.rs @@ -1,12 +1,11 @@ -use crate::{ - source::community::{Community, CommunitySafe}, - views::ViewToVec, - ToSafe, -}; +use crate::{views::ViewToVec, ToSafe}; use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, community_moderator, user_}, - source::user::{UserSafe, User_}, + source::{ + community::{Community, CommunitySafe}, + user::{UserSafe, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/community/community_user_ban_view.rs b/lemmy_db/src/views/community/community_user_ban_view.rs index 80ac78cc3..1c26ebcf1 100644 --- a/lemmy_db/src/views/community/community_user_ban_view.rs +++ b/lemmy_db/src/views/community/community_user_ban_view.rs @@ -1,11 +1,11 @@ -use crate::{ - source::community::{Community, CommunitySafe}, - ToSafe, -}; +use crate::ToSafe; use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, community_user_ban, user_}, - source::user::{UserSafe, User_}, + source::{ + community::{Community, CommunitySafe}, + user::{UserSafe, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/community/community_view.rs b/lemmy_db/src/views/community/community_view.rs index bd7119364..3ccaabd65 100644 --- a/lemmy_db/src/views/community/community_view.rs +++ b/lemmy_db/src/views/community/community_view.rs @@ -3,10 +3,7 @@ use crate::{ functions::hot_rank, fuzzy_search, limit_and_offset, - source::{ - category::Category, - community::{Community, CommunityFollower, CommunitySafe}, - }, + source::category::Category, views::ViewToVec, MaybeOptional, SortType, @@ -15,7 +12,10 @@ use crate::{ use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{category, community, community_aggregates, community_follower, user_}, - source::user::{UserSafe, User_}, + source::{ + community::{Community, CommunityFollower, CommunitySafe}, + user::{UserSafe, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/moderator/mod_add_community_view.rs b/lemmy_db/src/views/moderator/mod_add_community_view.rs index 2e0483221..8189286a5 100644 --- a/lemmy_db/src/views/moderator/mod_add_community_view.rs +++ b/lemmy_db/src/views/moderator/mod_add_community_view.rs @@ -1,16 +1,11 @@ -use crate::{ - limit_and_offset, - source::{ - community::{Community, CommunitySafe}, - moderator::ModAddCommunity, - }, - views::ViewToVec, - ToSafe, -}; +use crate::{limit_and_offset, source::moderator::ModAddCommunity, views::ViewToVec, ToSafe}; use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, mod_add_community, user_, user_alias_1}, - source::user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, + source::{ + community::{Community, CommunitySafe}, + user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/moderator/mod_ban_from_community_view.rs b/lemmy_db/src/views/moderator/mod_ban_from_community_view.rs index e31d6d19b..3c46f71a6 100644 --- a/lemmy_db/src/views/moderator/mod_ban_from_community_view.rs +++ b/lemmy_db/src/views/moderator/mod_ban_from_community_view.rs @@ -1,16 +1,11 @@ -use crate::{ - limit_and_offset, - source::{ - community::{Community, CommunitySafe}, - moderator::ModBanFromCommunity, - }, - views::ViewToVec, - ToSafe, -}; +use crate::{limit_and_offset, source::moderator::ModBanFromCommunity, views::ViewToVec, ToSafe}; use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, mod_ban_from_community, user_, user_alias_1}, - source::user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, + source::{ + community::{Community, CommunitySafe}, + user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/moderator/mod_lock_post_view.rs b/lemmy_db/src/views/moderator/mod_lock_post_view.rs index 9687e1b58..1c0ce7c76 100644 --- a/lemmy_db/src/views/moderator/mod_lock_post_view.rs +++ b/lemmy_db/src/views/moderator/mod_lock_post_view.rs @@ -1,16 +1,9 @@ -use crate::{ - limit_and_offset, - source::{ - community::{Community, CommunitySafe}, - moderator::ModLockPost, - }, - views::ViewToVec, - ToSafe, -}; +use crate::{limit_and_offset, source::moderator::ModLockPost, views::ViewToVec, ToSafe}; use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, mod_lock_post, post, user_}, source::{ + community::{Community, CommunitySafe}, post::Post, user::{UserSafe, User_}, }, diff --git a/lemmy_db/src/views/moderator/mod_remove_comment_view.rs b/lemmy_db/src/views/moderator/mod_remove_comment_view.rs index 70fb8cbdf..2edd72d9c 100644 --- a/lemmy_db/src/views/moderator/mod_remove_comment_view.rs +++ b/lemmy_db/src/views/moderator/mod_remove_comment_view.rs @@ -1,17 +1,10 @@ -use crate::{ - limit_and_offset, - source::{ - community::{Community, CommunitySafe}, - moderator::ModRemoveComment, - }, - views::ViewToVec, - ToSafe, -}; +use crate::{limit_and_offset, source::moderator::ModRemoveComment, views::ViewToVec, ToSafe}; use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{comment, community, mod_remove_comment, post, user_, user_alias_1}, source::{ comment::Comment, + community::{Community, CommunitySafe}, post::Post, user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, }, diff --git a/lemmy_db/src/views/moderator/mod_remove_community_view.rs b/lemmy_db/src/views/moderator/mod_remove_community_view.rs index 9e7fb6a45..e4d680f7e 100644 --- a/lemmy_db/src/views/moderator/mod_remove_community_view.rs +++ b/lemmy_db/src/views/moderator/mod_remove_community_view.rs @@ -1,16 +1,11 @@ -use crate::{ - limit_and_offset, - source::{ - community::{Community, CommunitySafe}, - moderator::ModRemoveCommunity, - }, - views::ViewToVec, - ToSafe, -}; +use crate::{limit_and_offset, source::moderator::ModRemoveCommunity, views::ViewToVec, ToSafe}; use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, mod_remove_community, user_}, - source::user::{UserSafe, User_}, + source::{ + community::{Community, CommunitySafe}, + user::{UserSafe, User_}, + }, }; use serde::Serialize; diff --git a/lemmy_db/src/views/moderator/mod_remove_post_view.rs b/lemmy_db/src/views/moderator/mod_remove_post_view.rs index fe976c8ea..1d5943b8c 100644 --- a/lemmy_db/src/views/moderator/mod_remove_post_view.rs +++ b/lemmy_db/src/views/moderator/mod_remove_post_view.rs @@ -1,16 +1,9 @@ -use crate::{ - limit_and_offset, - source::{ - community::{Community, CommunitySafe}, - moderator::ModRemovePost, - }, - views::ViewToVec, - ToSafe, -}; +use crate::{limit_and_offset, source::moderator::ModRemovePost, views::ViewToVec, ToSafe}; use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, mod_remove_post, post, user_}, source::{ + community::{Community, CommunitySafe}, post::Post, user::{UserSafe, User_}, }, diff --git a/lemmy_db/src/views/moderator/mod_sticky_post_view.rs b/lemmy_db/src/views/moderator/mod_sticky_post_view.rs index c51d083f0..0bd775dc9 100644 --- a/lemmy_db/src/views/moderator/mod_sticky_post_view.rs +++ b/lemmy_db/src/views/moderator/mod_sticky_post_view.rs @@ -1,16 +1,9 @@ -use crate::{ - limit_and_offset, - source::{ - community::{Community, CommunitySafe}, - moderator::ModStickyPost, - }, - views::ViewToVec, - ToSafe, -}; +use crate::{limit_and_offset, source::moderator::ModStickyPost, views::ViewToVec, ToSafe}; use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, mod_sticky_post, post, user_}, source::{ + community::{Community, CommunitySafe}, post::Post, user::{UserSafe, User_}, }, diff --git a/lemmy_db/src/views/post_report_view.rs b/lemmy_db/src/views/post_report_view.rs index 9c42f7769..dcb74b36a 100644 --- a/lemmy_db/src/views/post_report_view.rs +++ b/lemmy_db/src/views/post_report_view.rs @@ -1,9 +1,6 @@ use crate::{ limit_and_offset, - source::{ - community::{Community, CommunitySafe}, - post_report::PostReport, - }, + source::post_report::PostReport, views::ViewToVec, MaybeOptional, ToSafe, @@ -12,6 +9,7 @@ use diesel::{result::Error, *}; use lemmy_db_schema::{ schema::{community, post, post_report, user_, user_alias_1, user_alias_2}, source::{ + community::{Community, CommunitySafe}, post::Post, user::{UserAlias1, UserAlias2, UserSafe, UserSafeAlias1, UserSafeAlias2, User_}, }, diff --git a/lemmy_db/src/views/post_view.rs b/lemmy_db/src/views/post_view.rs index e3bdd178f..358b46cd8 100644 --- a/lemmy_db/src/views/post_view.rs +++ b/lemmy_db/src/views/post_view.rs @@ -3,7 +3,6 @@ use crate::{ functions::hot_rank, fuzzy_search, limit_and_offset, - source::community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, views::ViewToVec, ListingType, MaybeOptional, @@ -24,6 +23,7 @@ use lemmy_db_schema::{ user_, }, source::{ + community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, post::{Post, PostRead, PostSaved}, user::{UserSafe, User_}, }, @@ -408,14 +408,13 @@ impl ViewToVec for PostView { mod tests { use crate::{ aggregates::post_aggregates::PostAggregates, - source::community::*, tests::establish_unpooled_connection, views::post_view::{PostQueryBuilder, PostView}, Crud, Likeable, *, }; - use lemmy_db_schema::source::{post::*, user::*}; + use lemmy_db_schema::source::{community::*, post::*, user::*}; #[test] fn test_crud() { diff --git a/lemmy_db/src/views/user_mention_view.rs b/lemmy_db/src/views/user_mention_view.rs index 61a788a40..373b3e1a5 100644 --- a/lemmy_db/src/views/user_mention_view.rs +++ b/lemmy_db/src/views/user_mention_view.rs @@ -2,10 +2,7 @@ use crate::{ aggregates::comment_aggregates::CommentAggregates, functions::hot_rank, limit_and_offset, - source::{ - community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, - user_mention::UserMention, - }, + source::user_mention::UserMention, views::ViewToVec, MaybeOptional, SortType, @@ -28,6 +25,7 @@ use lemmy_db_schema::{ }, source::{ comment::{Comment, CommentSaved}, + community::{Community, CommunityFollower, CommunitySafe, CommunityUserBan}, post::Post, user::{UserAlias1, UserSafe, UserSafeAlias1, User_}, }, diff --git a/lemmy_db_schema/src/source/community.rs b/lemmy_db_schema/src/source/community.rs new file mode 100644 index 000000000..af7fce0c9 --- /dev/null +++ b/lemmy_db_schema/src/source/community.rs @@ -0,0 +1,121 @@ +use crate::schema::{community, community_follower, community_moderator, community_user_ban}; +use serde::Serialize; + +#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] +#[table_name = "community"] +pub struct Community { + pub id: i32, + pub name: String, + pub title: String, + pub description: Option, + pub category_id: i32, + pub creator_id: i32, + pub removed: bool, + pub published: chrono::NaiveDateTime, + pub updated: Option, + pub deleted: bool, + pub nsfw: bool, + pub actor_id: String, + pub local: bool, + pub private_key: Option, + pub public_key: Option, + pub last_refreshed_at: chrono::NaiveDateTime, + pub icon: Option, + pub banner: Option, +} + +/// A safe representation of community, without the sensitive info +#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)] +#[table_name = "community"] +pub struct CommunitySafe { + pub id: i32, + pub name: String, + pub title: String, + pub description: Option, + pub category_id: i32, + pub creator_id: i32, + pub removed: bool, + pub published: chrono::NaiveDateTime, + pub updated: Option, + pub deleted: bool, + pub nsfw: bool, + pub actor_id: String, + pub local: bool, + pub icon: Option, + pub banner: Option, +} + +#[derive(Insertable, AsChangeset, Debug)] +#[table_name = "community"] +pub struct CommunityForm { + pub name: String, + pub title: String, + pub description: Option, + pub category_id: i32, + pub creator_id: i32, + pub removed: Option, + pub published: Option, + pub updated: Option, + pub deleted: Option, + pub nsfw: bool, + pub actor_id: Option, + pub local: bool, + pub private_key: Option, + pub public_key: Option, + pub last_refreshed_at: Option, + pub icon: Option>, + pub banner: Option>, +} + +#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] +#[belongs_to(Community)] +#[table_name = "community_moderator"] +pub struct CommunityModerator { + pub id: i32, + pub community_id: i32, + pub user_id: i32, + pub published: chrono::NaiveDateTime, +} + +#[derive(Insertable, AsChangeset, Clone)] +#[table_name = "community_moderator"] +pub struct CommunityModeratorForm { + pub community_id: i32, + pub user_id: i32, +} + +#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] +#[belongs_to(Community)] +#[table_name = "community_user_ban"] +pub struct CommunityUserBan { + pub id: i32, + pub community_id: i32, + pub user_id: i32, + pub published: chrono::NaiveDateTime, +} + +#[derive(Insertable, AsChangeset, Clone)] +#[table_name = "community_user_ban"] +pub struct CommunityUserBanForm { + pub community_id: i32, + pub user_id: i32, +} + +#[derive(Identifiable, Queryable, Associations, PartialEq, Debug)] +#[belongs_to(Community)] +#[table_name = "community_follower"] +pub struct CommunityFollower { + pub id: i32, + pub community_id: i32, + pub user_id: i32, + pub published: chrono::NaiveDateTime, + pub pending: Option, +} + +#[derive(Insertable, AsChangeset, Clone)] +#[table_name = "community_follower"] +pub struct CommunityFollowerForm { + pub community_id: i32, + pub user_id: i32, + pub pending: bool, +} diff --git a/lemmy_db_schema/src/source/mod.rs b/lemmy_db_schema/src/source/mod.rs index 2a5d7a699..350b39045 100644 --- a/lemmy_db_schema/src/source/mod.rs +++ b/lemmy_db_schema/src/source/mod.rs @@ -1,3 +1,4 @@ pub mod comment; +pub mod community; pub mod post; pub mod user; diff --git a/src/code_migrations.rs b/src/code_migrations.rs index 2afdfabda..cd4176bf7 100644 --- a/src/code_migrations.rs +++ b/src/code_migrations.rs @@ -4,18 +4,14 @@ use diesel::{ *, }; use lemmy_db::{ - source::{ - comment::Comment_, - community::{Community, CommunityForm}, - post::Post_, - private_message::PrivateMessage, - }, + source::{comment::Comment_, post::Post_, private_message::PrivateMessage}, Crud, }; use lemmy_db_schema::{ naive_now, source::{ comment::Comment, + community::{Community, CommunityForm}, post::Post, user::{UserForm, User_}, }, diff --git a/src/routes/feeds.rs b/src/routes/feeds.rs index 8a3ecbae9..fc397fff0 100644 --- a/src/routes/feeds.rs +++ b/src/routes/feeds.rs @@ -4,7 +4,7 @@ use chrono::{DateTime, NaiveDateTime, Utc}; use diesel::PgConnection; use lemmy_api::claims::Claims; use lemmy_db::{ - source::{community::Community, user::User}, + source::{community::Community_, user::User}, views::{ comment_view::{CommentQueryBuilder, CommentView}, post_view::{PostQueryBuilder, PostView}, @@ -14,7 +14,7 @@ use lemmy_db::{ ListingType, SortType, }; -use lemmy_db_schema::source::user::User_; +use lemmy_db_schema::source::{community::Community, user::User_}; use lemmy_structs::blocking; use lemmy_utils::{settings::Settings, utils::markdown_to_html, LemmyError}; use lemmy_websocket::LemmyContext; diff --git a/src/routes/webfinger.rs b/src/routes/webfinger.rs index 57c90c967..2a03f5e2a 100644 --- a/src/routes/webfinger.rs +++ b/src/routes/webfinger.rs @@ -1,7 +1,7 @@ use actix_web::{error::ErrorBadRequest, web::Query, *}; use anyhow::anyhow; -use lemmy_db::source::{community::Community, user::User}; -use lemmy_db_schema::source::user::User_; +use lemmy_db::source::{community::Community_, user::User}; +use lemmy_db_schema::source::{community::Community, user::User_}; use lemmy_structs::{blocking, WebFingerLink, WebFingerResponse}; use lemmy_utils::{ settings::Settings, diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 5a191352a..7c346d865 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -28,13 +28,11 @@ use lemmy_apub::{ user_inbox::user_inbox, }, }; -use lemmy_db::{ - source::community::{Community, CommunityForm}, - Crud, - ListingType, - SortType, +use lemmy_db::{Crud, ListingType, SortType}; +use lemmy_db_schema::source::{ + community::{Community, CommunityForm}, + user::{UserForm, User_}, }; -use lemmy_db_schema::source::user::{UserForm, User_}; use lemmy_rate_limit::{rate_limiter::RateLimiter, RateLimit}; use lemmy_utils::{apub::generate_actor_keypair, settings::Settings}; use lemmy_websocket::{chat_server::ChatServer, LemmyContext}; From 52316664655ef287013017982efe1fe60997b4a9 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 21 Dec 2020 14:38:34 +0100 Subject: [PATCH 5/6] Move remaining structs from lemmy_db::source to lemmy_db_schema --- cargo-timing.html | 27368 ++++++++-------- lemmy_api/src/comment.rs | 12 +- lemmy_api/src/community.rs | 4 +- lemmy_api/src/post.rs | 12 +- lemmy_api/src/site.rs | 11 +- lemmy_api/src/user.rs | 20 +- .../src/activities/receive/private_message.rs | 3 +- .../src/activities/send/private_message.rs | 4 +- lemmy_apub/src/extensions/group_extensions.rs | 3 +- lemmy_apub/src/http/mod.rs | 3 +- lemmy_apub/src/inbox/mod.rs | 4 +- lemmy_apub/src/inbox/receive_for_community.rs | 4 +- lemmy_apub/src/inbox/user_inbox.rs | 7 +- lemmy_apub/src/lib.rs | 4 +- lemmy_apub/src/objects/private_message.rs | 9 +- lemmy_db/src/source/activity.rs | 57 +- lemmy_db/src/source/category.rs | 27 +- lemmy_db/src/source/comment_report.rs | 30 +- lemmy_db/src/source/moderator.rs | 205 +- lemmy_db/src/source/password_reset_request.rs | 63 +- lemmy_db/src/source/post_report.rs | 31 +- lemmy_db/src/source/private_message.rs | 91 +- lemmy_db/src/source/site.rs | 42 +- lemmy_db/src/source/user_mention.rs | 54 +- lemmy_db/src/views/comment_report_view.rs | 9 +- .../src/views/community/community_view.rs | 2 +- .../views/moderator/mod_add_community_view.rs | 3 +- lemmy_db/src/views/moderator/mod_add_view.rs | 7 +- .../moderator/mod_ban_from_community_view.rs | 3 +- lemmy_db/src/views/moderator/mod_ban_view.rs | 7 +- .../src/views/moderator/mod_lock_post_view.rs | 3 +- .../moderator/mod_remove_comment_view.rs | 3 +- .../moderator/mod_remove_community_view.rs | 3 +- .../views/moderator/mod_remove_post_view.rs | 3 +- .../views/moderator/mod_sticky_post_view.rs | 3 +- lemmy_db/src/views/post_report_view.rs | 9 +- lemmy_db/src/views/private_message_view.rs | 13 +- lemmy_db/src/views/site_view.rs | 7 +- lemmy_db/src/views/user_mention_view.rs | 2 +- lemmy_db_schema/src/source/activity.rs | 25 + lemmy_db_schema/src/source/category.rs | 15 + lemmy_db_schema/src/source/comment_report.rs | 26 + lemmy_db_schema/src/source/mod.rs | 9 + lemmy_db_schema/src/source/moderator.rs | 194 + .../src/source/password_reset_request.rs | 17 + lemmy_db_schema/src/source/post_report.rs | 30 + lemmy_db_schema/src/source/private_message.rs | 31 + lemmy_db_schema/src/source/site.rs | 33 + lemmy_db_schema/src/source/user_mention.rs | 21 + lemmy_structs/src/lib.rs | 14 +- lemmy_structs/src/site.rs | 3 +- src/code_migrations.rs | 3 +- 52 files changed, 13966 insertions(+), 14600 deletions(-) create mode 100644 lemmy_db_schema/src/source/activity.rs create mode 100644 lemmy_db_schema/src/source/category.rs create mode 100644 lemmy_db_schema/src/source/comment_report.rs create mode 100644 lemmy_db_schema/src/source/moderator.rs create mode 100644 lemmy_db_schema/src/source/password_reset_request.rs create mode 100644 lemmy_db_schema/src/source/post_report.rs create mode 100644 lemmy_db_schema/src/source/private_message.rs create mode 100644 lemmy_db_schema/src/source/site.rs create mode 100644 lemmy_db_schema/src/source/user_mention.rs diff --git a/cargo-timing.html b/cargo-timing.html index c14605108..6fee64e39 100644 --- a/cargo-timing.html +++ b/cargo-timing.html @@ -130,10 +130,10 @@ h1 { Max concurrency:12 (jobs=12 ncpu=12) - Build start:2020-12-19T14:19:46Z + Build start:2020-12-21T13:35:31Z - Total time:191.9s (3m 11.9s) + Total time:168.7s (2m 48.7s) rustc:rustc 1.50.0-nightly (825637983 2020-11-18)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu @@ -182,1429 +182,1325 @@ h1 { 1. lemmy_db v0.1.0 - 45.2s - 6.9s (15%) + 38.6s + 5.5s (14%) 2. diesel v1.4.5 - 23.2s - 0.6s (2%) + 22.2s + 0.4s (2%) 32-column-tables, bitflags, chrono, default, postgres, pq-sys, r2d2, serde_json, with-deprecated 3. - syn v1.0.54 - 19.5s - 7.8s (40%) - clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut + rustls v0.18.1 + 16.6s + 11.6s (70%) + dangerous_configuration, default, log, logging 4. - h2 v0.2.7 - 18.6s - 8.8s (47%) - - - - - 5. - lemmy_server v0.0.1 - 18.4s - 13.2s (72%) - - - - - 6. serde_derive v1.0.118 - 16.5s + 16.2s 0.0s (0%) default - 7. - lemmy_server v0.0.1 bin "lemmy_server" - 15.8s + 5. + derive_more v0.99.11 + 15.6s 0.0s (0%) + add, add_assign, as_mut, as_ref, constructor, default, deref, deref_mut, display, error, from, from_str, index, index_mut, into, into_iterator, iterator, mul, mul_assign, not, sum, try_into + + + + 6. + syn v1.0.54 + 15.2s + 3.4s (23%) + clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut + + + + 7. + lemmy_server v0.0.1 + 14.3s + 8.9s (62%) 8. diesel_derives v1.4.1 - 14.2s + 12.9s 0.0s (0%) default, postgres 9. - hyper v0.13.9 - 14.2s - 0.8s (6%) - socket2, tcp + tokio v0.2.24 + 12.5s + 6.0s (48%) + blocking, default, fnv, futures-core, io-driver, io-util, iovec, lazy_static, libc, memchr, mio, mio-uds, rt-core, rt-util, signal, signal-hook-registry, slab, stream, sync, tcp, time, udp, uds, winapi 10. - derive_more v0.99.11 - 14.1s + brotli-sys v0.3.2 custom-build (run) + 11.8s 0.0s (0%) - add, add_assign, as_mut, as_ref, constructor, default, deref, deref_mut, display, error, from, from_str, index, index_mut, into, into_iterator, iterator, mul, mul_assign, not, sum, try_into + 11. - activitystreams v0.7.0-alpha.8 - 13.3s - 2.7s (20%) + h2 v0.2.7 + 11.4s + 4.4s (38%) 12. - trust-dns-proto v0.19.6 - 12.9s - 8.6s (66%) - tokio, tokio-runtime + regex v1.4.2 + 11.1s + 8.2s (74%) + aho-corasick, default, memchr, perf, perf-cache, perf-dfa, perf-inline, perf-literal, std, thread_local, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment 13. - regex-syntax v0.6.21 - 12.8s - 5.0s (39%) - default, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment + hyper v0.13.9 + 10.6s + 1.1s (10%) + socket2, tcp 14. image v0.23.12 - 12.6s - 5.5s (44%) + 10.5s + 4.2s (39%) bmp, dds, default, dxt, farbfeld, gif, hdr, ico, jpeg, jpeg_rayon, png, pnm, scoped_threadpool, tga, tiff, webp 15. - lettre v0.10.0-alpha.4 - 12.4s - 1.6s (13%) - base64, builder, default, file-transport, hostname, hyperx, mime, native-tls, nom, quoted_printable, r2d2, rand, sendmail-transport, serde, serde_json, smtp-transport + regex-syntax v0.6.21 + 10.5s + 5.0s (47%) + default, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment 16. - pin-project-internal v0.4.27 - 12.2s - 0.0s (0%) - + object v0.22.0 + 10.4s + 4.5s (43%) + archive, coff, elf, macho, pe, read_core, unaligned 17. - async-trait v0.1.42 - 11.9s - 0.0s (0%) + lemmy_apub v0.1.0 + 10.2s + 4.4s (43%) 18. - regex v1.4.2 - 11.5s - 8.6s (75%) - aho-corasick, default, memchr, perf, perf-cache, perf-dfa, perf-inline, perf-literal, std, thread_local, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment + lemmy_api v0.1.0 + 10.0s + 4.5s (45%) + 19. - thiserror-impl v1.0.22 - 11.2s - 0.0s (0%) + lemmy_db_schema v0.1.0 + 10.0s + 1.2s (12%) 20. - trust-dns-resolver v0.19.6 - 11.0s - 2.8s (25%) - ipconfig, resolv-conf, system-config, tokio, tokio-runtime + darling_core v0.10.2 + 9.8s + 6.0s (61%) + strsim, suggestions 21. - rayon v1.5.0 - 10.5s - 0.8s (8%) - + futures-util v0.3.8 + 9.7s + 0.2s (2%) + alloc, async-await, async-await-macro, channel, default, futures-channel, futures-io, futures-macro, futures-sink, io, memchr, proc-macro-hack, proc-macro-nested, sink, slab, std 22. - object v0.22.0 - 10.4s - 4.3s (41%) - archive, coff, elf, macho, pe, read_core, unaligned + encoding_rs v0.8.26 + 9.1s + 4.2s (46%) + 23. - lemmy_api v0.1.0 - 10.2s - 4.7s (46%) + comrak v0.9.0 + 9.1s + 4.4s (49%) 24. - lemmy_apub v0.1.0 - 10.2s - 4.3s (42%) + strum_macros v0.20.1 + 8.8s + 0.0s (0%) 25. - tokio v0.2.24 - 10.1s - 2.9s (29%) - blocking, default, fnv, futures-core, io-driver, io-util, iovec, lazy_static, libc, memchr, mio, mio-uds, rt-core, rt-util, signal, signal-hook-registry, slab, stream, sync, tcp, time, udp, uds, winapi + openssl v0.10.31 + 8.4s + 2.8s (33%) + 26. - lemmy_db_schema v0.1.0 - 9.6s - 0.8s (9%) + pest_meta v2.1.3 + 8.1s + 5.2s (65%) 27. - rustls v0.18.1 - 9.2s - 3.7s (40%) - dangerous_configuration, default, log, logging + actix-http v2.2.0 + 7.8s + 3.1s (39%) + actix-tls, brotli2, compress, default, flate2, rustls 28. - strum_macros v0.20.1 - 9.2s - 0.0s (0%) - + actix-web v3.3.2 + 7.5s + 1.2s (15%) + compress, default, rust-tls, rustls 29. - darling_macro v0.10.2 - 8.5s - 0.0s (0%) + activitystreams v0.7.0-alpha.8 + 7.4s + 1.2s (17%) 30. - comrak v0.9.0 - 8.3s - 3.9s (47%) + http v0.2.2 + 7.3s + 2.1s (28%) 31. - openssl v0.10.31 - 8.2s - 2.8s (34%) - + gimli v0.23.0 + 7.3s + 1.2s (17%) + read 32. - brotli-sys v0.3.2 custom-build (run) - 8.2s - 0.0s (0%) - + serde_json v1.0.60 + 7.0s + 4.6s (65%) + default, indexmap, preserve_order, std 33. - actix_derive v0.5.0 - 8.2s + pin-project-internal v0.4.27 + 7.0s 0.0s (0%) 34. - encoding_rs v0.8.26 - 7.7s - 3.8s (49%) - + jpeg-decoder v0.1.20 + 6.7s + 5.2s (78%) + rayon 35. - darling_core v0.10.2 - 7.7s - 2.3s (30%) - strsim, suggestions + reqwest v0.10.10 + 6.6s + 4.4s (66%) + __tls, default, default-tls, hyper-tls, json, native-tls-crate, serde_json, tokio-tls 36. - gimli v0.23.0 - 7.6s - 1.3s (17%) - read + hyperx v1.2.0 + 6.5s + 3.4s (51%) + headers 37. - pin-project-internal v1.0.2 - 7.6s - 0.0s (0%) - + time v0.2.23 + 6.4s + 2.0s (31%) + libc, std, stdweb, winapi 38. - futures-util v0.3.8 - 7.4s - 0.3s (4%) - alloc, async-await, async-await-macro, channel, default, futures-channel, futures-io, futures-macro, futures-sink, io, memchr, proc-macro-hack, proc-macro-nested, sink, slab, std + ring v0.16.19 + 6.2s + 3.0s (49%) + alloc, default, dev_urandom_fallback, once_cell, std 39. - rand v0.7.3 - 7.3s - 0.9s (12%) - alloc, default, getrandom, getrandom_package, libc, std + chrono v0.4.19 + 6.0s + 3.5s (59%) + clock, default, libc, oldtime, serde, std, time, winapi 40. - rayon-core v1.9.0 - 7.1s - 5.5s (78%) + lemmy_server v0.0.1 bin "lemmy_server" + 5.9s + 0.0s (0%) 41. - pest_generator v2.1.3 - 7.1s - 1.6s (23%) - - - - - 42. - http v0.2.2 - 7.0s - 1.9s (27%) - - - - - 43. serde v1.0.118 - 6.8s - 0.7s (11%) + 5.8s + 0.5s (8%) default, derive, serde_derive, std - 44. - ring v0.16.19 - 6.7s - 3.6s (53%) - alloc, default, dev_urandom_fallback, once_cell, std - - - - 45. - pest_meta v2.1.3 - 6.6s - 4.9s (75%) - - - - - 46. - hyperx v1.2.0 - 6.3s - 3.2s (50%) - headers - - - - 47. - actix-web v3.3.2 - 6.1s - 1.5s (25%) - compress, default, rust-tls, rustls - - - - 48. - cc v1.0.66 - 5.9s - 3.9s (66%) - - - - - 49. - actix-http v2.2.0 - 5.7s - 1.0s (19%) - actix-tls, brotli2, compress, default, flate2, rustls - - - - 50. - nom v6.0.1 - 5.6s - 0.5s (9%) - alloc, bitvec - - - - 51. - nom v5.1.2 - 5.4s - 0.8s (14%) - alloc, default, lexical, lexical-core, std - - - - 52. - serde v0.8.23 - 5.3s - 0.3s (6%) + 42. + aho-corasick v0.7.15 + 5.8s + 3.0s (52%) default, std + + 43. + pin-project-internal v1.0.2 + 5.8s + 0.0s (0%) + + + + + 44. + tiff v0.6.1 + 5.8s + 0.9s (15%) + + + + + 45. + ring v0.16.19 custom-build (run) + 5.6s + 0.0s (0%) + alloc, default, dev_urandom_fallback, once_cell, std + + + + 46. + nom v5.1.2 + 5.6s + 0.6s (11%) + alloc, default, lexical, lexical-core, std + + + + 47. + trust-dns-proto v0.19.6 + 5.6s + 1.8s (33%) + tokio, tokio-runtime + + + + 48. + nom v6.0.1 + 5.4s + 0.5s (10%) + alloc, bitvec + + + + 49. + darling_macro v0.10.2 + 5.2s + 0.0s (0%) + + + + + 50. + awc v2.0.3 + 5.0s + 2.2s (43%) + compress, rust-tls, rustls + + + + 51. + lodepng v3.2.2 + 5.0s + 3.1s (62%) + default, rust_backend + + + + 52. + rayon v1.5.0 + 4.9s + 0.5s (10%) + + + 53. - reqwest v0.10.10 - 5.3s - 3.3s (62%) - __tls, default, default-tls, hyper-tls, json, native-tls-crate, serde_json, tokio-tls - - - - 54. - time v0.2.23 - 5.3s - 2.2s (42%) - libc, std, stdweb, winapi - - - - 55. backtrace v0.3.55 - 5.1s - 4.0s (79%) + 4.9s + 3.8s (78%) addr2line, default, gimli-symbolize, miniz_oxide, object, std - 56. + 54. + config v0.10.1 + 4.8s + 3.5s (73%) + hjson, serde-hjson + + + + 55. bitvec v0.19.4 - 4.9s + 4.8s 0.1s (1%) alloc + + 56. + async-trait v0.1.42 + 4.8s + 0.0s (0%) + + + 57. - aho-corasick v0.7.15 - 4.9s - 2.7s (56%) + serde v0.8.23 + 4.8s + 0.3s (7%) default, std 58. - ryu v1.0.5 custom-build - 4.8s - 0.0s (0%) + cc v1.0.66 + 4.5s + 3.1s (69%) 59. - num-bigint v0.2.6 - 4.8s - 1.4s (30%) - default, std + lettre v0.10.0-alpha.4 + 4.5s + 1.2s (26%) + base64, builder, default, file-transport, hostname, hyperx, mime, native-tls, nom, quoted_printable, r2d2, rand, sendmail-transport, serde, serde_json, smtp-transport 60. + serde-hjson v0.9.1 + 4.5s + 2.7s (60%) + default, linked-hash-map, preserve_order + + + + 61. lemmy_structs v0.1.0 - 4.7s + 4.4s 0.4s (8%) - - 61. - lodepng v3.2.2 - 4.7s - 2.8s (59%) - default, rust_backend - - 62. - awc v2.0.3 - 4.5s - 3.0s (66%) - compress, rust-tls, rustls + proc-macro-hack v0.5.19 + 4.4s + 0.0s (0%) + 63. - derive_builder v0.9.0 - 4.2s - 0.0s (0%) - - - - - 64. - tiff v0.6.1 - 4.2s - 2.8s (67%) - - - - - 65. lexical-core v0.7.4 - 4.1s - 0.3s (7%) + 4.2s + 0.4s (8%) arrayvec, correct, default, ryu, static_assertions, std, table - 66. - actix-server v1.0.4 + 64. + trust-dns-resolver v0.19.6 4.1s - 2.2s (52%) - default + 2.0s (49%) + ipconfig, resolv-conf, system-config, tokio, tokio-runtime - 67. - jpeg-decoder v0.1.20 - 4.0s - 2.1s (52%) - rayon - - - - 68. - serde_json v1.0.60 - 3.9s - 0.8s (21%) - default, indexmap, preserve_order, std - - - - 69. - serde-hjson v0.9.1 - 3.8s - 2.2s (59%) - default, linked-hash-map, preserve_order - - - - 70. - v_escape_derive v0.8.4 - 3.8s + 65. + thiserror-impl v1.0.22 + 4.1s 0.0s (0%) - 71. - futures-macro v0.3.8 + 66. + proc-macro2 v1.0.24 + 4.0s + 2.2s (54%) + default, proc-macro + + + + 67. + num-bigint v0.2.6 + 4.0s + 1.5s (37%) + default, std + + + + 68. + rand v0.7.3 + 3.8s + 0.9s (23%) + alloc, default, getrandom, getrandom_package, libc, std + + + + 69. + pest v2.1.3 3.7s - 0.0s (0%) + 1.0s (27%) + + + + + 70. + tokio v0.3.6 + 3.6s + 1.1s (32%) + default, sync + + + + 71. + miniz_oxide v0.3.7 + 3.3s + 1.9s (57%) 72. - pest v2.1.3 - 3.5s - 0.5s (13%) - + nom v4.2.3 + 3.2s + 0.7s (23%) + alloc, default, std 73. - chrono v0.4.19 - 3.4s - 0.4s (13%) - clock, default, libc, oldtime, serde, std, time, winapi + itertools v0.9.0 + 3.2s + 0.9s (28%) + default, use_std 74. - tokio v0.3.6 - 3.3s - 1.4s (41%) - default, sync + mio v0.6.23 + 3.1s + 1.3s (42%) + default, with-deprecated 75. - rand_chacha v0.2.2 - 3.2s - 2.2s (69%) - std + actix-web-codegen v0.4.0 + 3.1s + 0.0s (0%) + 76. - proc-macro-hack v0.5.19 - 3.1s - 0.0s (0%) + rayon-core v1.9.0 + 2.9s + 1.6s (56%) 77. - lemmy_utils v0.1.0 - 3.1s + unicode-normalization v0.1.16 + 2.9s 0.6s (21%) - + default, std 78. - mio v0.6.23 - 3.1s - 1.4s (45%) - default, with-deprecated + v_escape_derive v0.8.4 + 2.8s + 0.0s (0%) + 79. - typenum v1.12.0 custom-build - 3.0s - 0.0s (0%) + lemmy_utils v0.1.0 + 2.7s + 0.6s (24%) 80. - miniz_oxide v0.3.7 - 3.0s - 1.4s (48%) + futures-macro v0.3.8 + 2.6s + 0.0s (0%) 81. - proc-macro2 v1.0.24 - 3.0s - 1.6s (53%) - default, proc-macro + tinyvec v1.1.0 + 2.6s + 0.1s (3%) + alloc, default, tinyvec_macros 82. - actix v0.10.0 - 3.0s - 0.3s (9%) - default, resolver, trust-dns-proto, trust-dns-resolver + num-traits v0.2.14 + 2.6s + 0.1s (6%) + default, i128, std 83. - ring v0.16.19 custom-build (run) - 3.0s - 0.0s (0%) - alloc, default, dev_urandom_fallback, once_cell, std + miniz_oxide v0.4.3 + 2.6s + 1.0s (40%) + no_extern_crate_alloc 84. - config v0.10.1 - 3.0s - 1.5s (49%) - hjson, serde-hjson + actix v0.10.0 + 2.6s + 0.3s (13%) + default, resolver, trust-dns-proto, trust-dns-resolver 85. - actix-web-codegen v0.4.0 - 3.0s - 0.0s (0%) + num-rational v0.3.2 + 2.6s + 1.5s (57%) 86. - base64 v0.13.0 - 2.9s - 0.3s (12%) - default, std + typenum v1.12.0 + 2.6s + 0.1s (4%) + 87. - itertools v0.9.0 - 2.9s - 0.5s (17%) - default, use_std - - - - 88. - url v2.2.0 - 2.8s - 0.8s (30%) - serde - - - - 89. - pkg-config v0.3.19 - 2.8s - 1.2s (44%) - - - - - 90. - rss v1.9.0 - 2.8s - 0.7s (24%) - builders, default, derive_builder - - - - 91. - unicode-segmentation v1.7.1 - 2.7s - 0.3s (12%) - - - - - 92. - nom v4.2.3 - 2.7s - 1.0s (36%) - alloc, default, std - - - - 93. - bytes v0.5.6 - 2.7s - 0.5s (18%) - default, std - - - - 94. - httparse v1.3.4 custom-build - 2.6s - 0.0s (0%) - default, std - - - - 95. - unicode-normalization v0.1.16 - 2.6s - 0.4s (16%) - default, std - - - - 96. - time-macros-impl v0.1.1 - 2.6s - 0.0s (0%) - - - - - 97. deflate v0.8.6 - 2.6s + 2.5s 1.3s (52%) - 98. + 88. + const_fn v0.4.4 + 2.5s + 0.0s (0%) + + + + + 89. + png v0.16.8 + 2.5s + 1.0s (39%) + default, deflate, png-encoding + + + + 90. + gif v0.11.1 + 2.4s + 1.4s (57%) + default, raii_no_panic, std + + + + 91. + background-jobs-core v0.8.0 + 2.4s + 0.4s (15%) + actix-rt, default, tokio, with-actix + + + + 92. + pest_generator v2.1.3 + 2.4s + 1.1s (47%) + + + + + 93. + funty v1.0.1 + 2.3s + 1.1s (47%) + + + + + 94. idna v0.2.0 - 2.6s - 1.2s (45%) + 2.3s + 0.9s (40%) + + + + + 95. + rand_chacha v0.2.2 + 2.3s + 1.7s (74%) + std + + + + 96. + ipnet v2.3.0 + 2.3s + 1.3s (57%) + + + + + 97. + num_cpus v1.13.0 + 2.3s + 1.4s (62%) + + + + + 98. + time v0.1.44 + 2.3s + 1.0s (44%) 99. - env_logger v0.8.2 - 2.5s - 1.1s (45%) - atty, default, humantime, regex, termcolor + webpki v0.21.4 + 2.2s + 0.7s (30%) + default, std, trust_anchor_util 100. - png v0.16.8 - 2.5s - 1.1s (43%) - default, deflate, png-encoding + url v2.2.0 + 2.2s + 0.5s (22%) + serde 101. - num-rational v0.3.2 - 2.5s - 1.4s (56%) - - - - - 102. - sha2 v0.9.2 - 2.4s - 0.8s (32%) - default, std - - - - 103. - base64 v0.12.3 - 2.3s - 0.4s (15%) - default, std - - - - 104. - actix-router v0.2.5 - 2.3s - 0.7s (30%) - default, http - - - - 105. - language-tags v0.2.2 - 2.3s - 1.7s (74%) - - - - - 106. - miniz_oxide v0.4.3 - 2.3s - 1.2s (51%) - no_extern_crate_alloc - - - - 107. mime_guess v2.0.3 custom-build - 2.3s + 2.2s 0.0s (0%) default, rev-mappings - 108. - crc32fast v1.2.1 custom-build + 102. + libc v0.2.81 2.2s - 0.0s (0%) - default, std + 0.2s (11%) + align, default, std - 109. - num-traits v0.2.14 - 2.2s - 0.2s (8%) - default, i128, std + 103. + actix-server v1.0.4 + 2.1s + 1.3s (59%) + default - 110. - tinyvec v1.1.0 - 2.2s - 0.0s (1%) - alloc, default, tinyvec_macros - - - - 111. - mime v0.3.16 - 2.2s - 1.7s (78%) + 104. + language-tags v0.2.2 + 2.1s + 1.6s (73%) + + 105. + signal-hook-registry v1.2.2 + 2.1s + 1.3s (62%) + + + + + 106. + time-macros-impl v0.1.1 + 2.1s + 0.0s (0%) + + + + + 107. + actix_derive v0.5.0 + 2.1s + 0.0s (0%) + + + + + 108. + captcha v0.0.8 + 2.1s + 1.3s (61%) + + + + + 109. + unicode-bidi v0.3.4 + 2.0s + 1.3s (61%) + default + + + + 110. + crossbeam-utils v0.7.2 custom-build (run) + 2.0s + 0.0s (0%) + default, lazy_static, std + + + + 111. + crossbeam-utils v0.8.1 custom-build (run) + 2.0s + 0.0s (0%) + default, lazy_static, std + + 112. - funty v1.0.1 - 2.2s - 1.0s (47%) + http-signature-normalization v0.5.3 + 2.0s + 1.3s (64%) 113. - ipnet v2.3.0 - 2.2s - 1.2s (54%) + pkg-config v0.3.19 + 2.0s + 1.3s (68%) 114. - v_htmlescape v0.11.0 - 2.1s - 0.6s (28%) - bytes-buf, default + actix-router v0.2.5 + 2.0s + 0.5s (25%) + default, http 115. - background-jobs-core v0.8.0 - 2.1s - 0.5s (22%) - actix-rt, default, tokio, with-actix + env_logger v0.8.2 + 1.9s + 1.0s (54%) + atty, default, humantime, regex, termcolor 116. - tracing-core v0.1.17 - 2.1s - 1.0s (51%) - lazy_static, std - - - - 117. - bytes v0.6.0 - 2.1s - 0.6s (31%) - default, std - - - - 118. lemmy_websocket v0.1.0 - 2.0s - 0.7s (36%) - - - - - 119. - bitflags v1.2.1 custom-build - 2.0s - 0.0s (0%) - default - - - - 120. - typenum v1.12.0 - 2.0s - 0.1s (3%) - - - - - 121. - actix-rt v1.1.1 - 2.0s - 1.1s (55%) - - - - - 122. - unicode-bidi v0.3.4 - 2.0s - 1.1s (57%) - default - - - - 123. - migrations_macros v1.4.2 - 2.0s - 0.0s (0%) - default - - - - 124. - libc v0.2.81 - 1.9s - 0.2s (10%) - align, default, std - - - - 125. - encoding_rs v0.8.26 custom-build - 1.9s - 0.0s (0%) - - - - - 126. - actix-files v0.4.1 1.9s 0.6s (32%) - 127. - byteorder v1.3.4 custom-build + 117. + tracing-core v0.1.17 1.9s - 0.0s (0%) + 0.9s (48%) + lazy_static, std + + + + 118. + crossbeam-channel v0.5.0 + 1.9s + 0.7s (34%) + crossbeam-utils, default, std + + + + 119. + net2 v0.2.37 + 1.9s + 1.1s (56%) + default, duration + + + + 120. + rss v1.9.0 + 1.9s + 0.4s (21%) + builders, default, derive_builder + + + + 121. + crossbeam-channel v0.4.4 + 1.9s + 0.6s (31%) + + + + + 122. + bytes v0.6.0 + 1.8s + 0.7s (36%) default, std - 128. - proc-macro-nested v0.1.6 custom-build - 1.9s + 123. + bytes v0.5.6 + 1.8s + 0.7s (36%) + default, std + + + + 124. + typenum v1.12.0 custom-build + 1.8s 0.0s (0%) + + 125. + ring v0.16.19 custom-build + 1.8s + 0.0s (0%) + alloc, default, dev_urandom_fallback, once_cell, std + + + + 126. + anyhow v1.0.35 + 1.8s + 0.9s (50%) + default, std + + + + 127. + derive_builder_core v0.9.0 + 1.8s + 0.9s (51%) + + + + + 128. + scoped_threadpool v0.1.9 + 1.8s + 1.4s (76%) + + + 129. - derive_builder_core v0.9.0 - 1.9s - 1.0s (54%) - + mime_guess v2.0.3 + 1.7s + 0.5s (30%) + default, rev-mappings 130. - enum-as-inner v0.3.3 - 1.9s - 0.0s (0%) - + memchr v2.3.4 + 1.7s + 0.8s (45%) + default, std, use_std 131. - percent-encoding v2.1.0 - 1.8s - 0.2s (13%) - + quote v1.0.7 + 1.7s + 0.9s (51%) + default, proc-macro 132. - scoped_threadpool v0.1.9 - 1.8s - 1.4s (78%) + socket2 v0.3.18 + 1.7s + 0.8s (49%) 133. - actix-utils v2.0.0 - 1.8s + v_htmlescape v0.11.0 + 1.7s 0.5s (28%) - + bytes-buf, default 134. - gif v0.11.1 - 1.8s - 0.7s (37%) - default, raii_no_panic, std - - - - 135. - serde_json v1.0.60 custom-build - 1.8s - 0.0s (0%) - default, indexmap, preserve_order, std - - - - 136. - smallvec v1.5.1 - 1.8s - 0.0s (3%) + native-tls v0.2.6 + 1.7s + 0.4s (21%) + + 135. + resolv-conf v0.7.0 + 1.7s + 0.8s (49%) + hostname, system + + + + 136. + quick-xml v0.17.2 + 1.7s + 0.7s (44%) + default, encoding, encoding_rs + + 137. - crossbeam-channel v0.5.0 - 1.8s - 0.6s (33%) - crossbeam-utils, default, std + weezl v0.1.3 + 1.6s + 0.9s (54%) + alloc, default, std 138. - pin-project-internal v0.4.27 custom-build - 1.8s + enum-as-inner v0.3.3 + 1.6s 0.0s (0%) 139. - ring v0.16.19 custom-build - 1.7s - 0.0s (0%) - alloc, default, dev_urandom_fallback, once_cell, std + autocfg v1.0.1 + 1.6s + 1.0s (63%) + 140. - crossbeam-channel v0.4.4 - 1.7s - 0.5s (30%) + brotli2 v0.3.2 + 1.6s + 0.3s (21%) 141. - signal-hook-registry v1.2.2 - 1.7s - 1.0s (56%) + parking_lot_core v0.8.1 + 1.6s + 0.7s (44%) 142. - quick-xml v0.17.2 - 1.7s - 0.7s (43%) - default, encoding, encoding_rs + openssl-sys v0.9.59 + 1.6s + 0.2s (14%) + 143. - cookie v0.14.3 - 1.7s - 1.0s (61%) - percent-encode, percent-encoding + flate2 v1.0.19 + 1.6s + 0.5s (29%) + default, miniz_oxide, rust_backend 144. - const_fn v0.4.4 - 1.7s - 0.0s (0%) - + bcrypt v0.9.0 + 1.6s + 0.4s (26%) + default, std 145. - actix-macros v0.1.3 - 1.7s - 0.0s (0%) - + crossbeam-utils v0.8.1 + 1.6s + 0.6s (42%) + default, lazy_static, std 146. - weezl v0.1.3 - 1.7s - 0.9s (54%) - alloc, default, std + indexmap v1.6.1 + 1.5s + 0.3s (16%) + 147. - time v0.1.44 - 1.7s - 0.7s (43%) + derive_builder v0.9.0 + 1.5s + 0.0s (0%) 148. - http-signature-normalization v0.5.3 - 1.6s - 0.9s (57%) + xdg v2.2.0 + 1.5s + 1.0s (65%) 149. - mime_guess v2.0.3 - 1.6s - 0.4s (27%) - default, rev-mappings + actix-files v0.4.1 + 1.5s + 0.4s (29%) + 150. - openssl-sys v0.9.59 custom-build - 1.6s - 0.0s (0%) + jsonwebtoken v7.2.0 + 1.5s + 0.4s (29%) 151. - pem v0.8.2 - 1.6s - 1.1s (70%) + rustc-demangle v0.1.18 + 1.5s + 0.8s (52%) 152. - hashbrown v0.9.1 - 1.6s - 0.1s (3%) - raw + sha2 v0.9.2 + 1.5s + 0.8s (54%) + default, std 153. - openssl-sys v0.9.59 - 1.6s - 0.2s (11%) - + parking_lot v0.11.1 + 1.4s + 0.8s (56%) + default 154. - jsonwebtoken v7.2.0 - 1.6s - 0.5s (34%) + openssl-sys v0.9.59 custom-build + 1.4s + 0.0s (0%) 155. - webpki v0.21.4 - 1.6s - 0.7s (44%) - default, std, trust_anchor_util + unicode-segmentation v1.7.1 + 1.4s + 0.3s (24%) + 156. - crossbeam-utils v0.8.1 custom-build (run) - 1.5s - 0.0s (0%) - default, lazy_static, std + tracing v0.1.22 + 1.4s + 0.5s (37%) + log, std 157. - resolv-conf v0.7.0 - 1.5s - 0.8s (51%) - hostname, system + twoway v0.2.1 + 1.4s + 0.7s (47%) + default, use_std 158. - http-signature-normalization-actix v0.4.1 - 1.5s - 0.4s (28%) - base64, digest, sha-2, sha2 + sct v0.6.0 + 1.4s + 1.0s (69%) + 159. - crossbeam-utils v0.7.2 custom-build (run) - 1.5s - 0.0s (0%) + crossbeam-utils v0.7.2 + 1.4s + 0.6s (45%) default, lazy_static, std 160. - flate2 v1.0.19 - 1.5s - 0.4s (27%) - default, miniz_oxide, rust_backend + termcolor v1.1.2 + 1.3s + 0.7s (50%) + 161. - crossbeam-utils v0.8.1 - 1.5s - 0.7s (47%) - default, lazy_static, std + version_check v0.9.2 + 1.3s + 0.8s (61%) + 162. - actix-service v1.0.6 - 1.5s - 0.0s (3%) - - - - - 163. - rustc-demangle v0.1.18 - 1.5s - 0.7s (49%) - - - - - 164. - autocfg v1.0.1 - 1.5s - 0.9s (63%) - - - - - 165. - crossbeam-utils v0.7.2 - 1.5s - 0.7s (45%) - default, lazy_static, std - - - - 166. - arrayvec v0.5.2 - 1.4s - 0.0s (2%) - array-sizes-33-128, default, std - - - - 167. - pest_derive v2.1.0 - 1.4s - 0.0s (0%) - - - - - 168. - simple_asn1 v0.4.1 - 1.4s + actix-rt v1.1.1 + 1.3s 0.7s (51%) - 169. - version_check v0.9.2 - 1.4s - 0.8s (57%) + 163. + num-integer v0.1.44 + 1.3s + 0.4s (32%) + i128, std + + + + 164. + addr2line v0.14.0 + 1.3s + 0.5s (40%) - 170. - serde_test v0.8.23 - 1.4s - 0.2s (11%) - - - - - 171. - xdg v2.2.0 - 1.4s - 0.8s (59%) - - - - - 172. - parking_lot v0.11.1 - 1.4s - 0.8s (58%) - default - - - - 173. - num_cpus v1.13.0 - 1.4s - 0.9s (63%) - - - - - 174. + 165. threadpool v1.8.1 - 1.4s - 1.0s (73%) + 1.3s + 0.8s (65%) - 175. - actix-web-actors v3.0.0 - 1.3s - 0.5s (38%) - - - - - 176. - termcolor v1.1.2 - 1.3s - 0.6s (45%) - - - - - 177. - socket2 v0.3.18 - 1.3s - 0.6s (48%) - - - - - 178. - anyhow v1.0.35 - 1.3s - 0.7s (53%) - default, std - - - - 179. + 166. httparse v1.3.4 1.3s 0.5s (41%) @@ -1612,95 +1508,103 @@ h1 { - 180. - net2 v0.2.37 + 167. + serde_test v0.8.23 1.3s - 0.6s (50%) - default, duration - - - - 181. - captcha v0.0.8 - 1.2s - 0.5s (37%) + 0.2s (17%) - 182. - memchr v2.3.4 - 1.2s - 0.5s (40%) - default, std, use_std + 168. + http-signature-normalization-actix v0.4.1 + 1.3s + 0.3s (21%) + base64, digest, sha-2, sha2 - 183. + 169. + hashbrown v0.9.1 + 1.3s + 0.1s (5%) + raw + + + + 170. crossbeam-epoch v0.9.1 - 1.2s - 0.5s (40%) + 1.3s + 0.6s (46%) alloc, lazy_static, std - 184. + 171. + pest_derive v2.1.0 + 1.3s + 0.0s (0%) + + + + + 172. + cookie v0.14.3 + 1.2s + 0.5s (39%) + percent-encode, percent-encoding + + + + 173. + actix-service v1.0.6 + 1.2s + 0.0s (2%) + + + + + 174. + httparse v1.3.4 custom-build + 1.2s + 0.0s (0%) + default, std + + + + 175. + version_check v0.1.5 + 1.2s + 0.8s (68%) + + + + + 176. tokio-util v0.3.1 1.2s - 0.4s (28%) + 0.4s (29%) codec, compat, default, full, futures-io, udp - 185. - version_check v0.1.5 + 177. + log v0.4.11 1.2s - 0.8s (65%) + 0.6s (46%) + std + + + + 178. + simple_asn1 v0.4.1 + 1.2s + 0.5s (42%) - 186. - strsim v0.9.3 - 1.2s - 0.8s (62%) - - - - - 187. - background-jobs-actix v0.8.0 - 1.2s - 0.3s (27%) - - - - - 188. - indexmap v1.6.1 - 1.2s - 0.1s (12%) - - - - - 189. - uuid v0.8.1 - 1.2s - 0.2s (21%) - default, rand, serde, std, v4 - - - - 190. - actix-connect v2.0.0 - 1.2s - 0.3s (27%) - default, http, rust-tls, rustls, tokio-rustls, uri, webpki - - - - 191. + 179. hyperx v1.2.0 custom-build 1.2s 0.0s (0%) @@ -1708,63 +1612,79 @@ h1 { - 192. - ppv-lite86 v0.2.10 - 1.1s - 0.0s (1%) - simd, std + 180. + arrayvec v0.5.2 + 1.2s + 0.0s (3%) + array-sizes-33-128, default, std - 193. - ucd-trie v0.1.3 + 181. + actix-macros v0.1.3 + 1.2s + 0.0s (0%) + + + + + 182. + unicase v2.6.0 custom-build (run) + 1.2s + 0.0s (0%) + + + + + 183. + byteorder v1.3.4 custom-build 1.1s - 0.7s (62%) + 0.0s (0%) default, std - 194. + 184. + ucd-trie v0.1.3 + 1.1s + 0.7s (64%) + default, std + + + + 185. + base64 v0.13.0 + 1.1s + 0.3s (30%) + default, std + + + + 186. + uuid v0.8.1 + 1.1s + 0.2s (15%) + default, rand, serde, std, v4 + + + + 187. + strsim v0.9.3 + 1.1s + 0.7s (59%) + + + + + 188. rgb v0.8.25 1.1s - 0.0s (4%) + 0.0s (3%) as-bytes, bytemuck, default - 195. - num-integer v0.1.44 - 1.1s - 0.3s (30%) - i128, std - - - - 196. - matches v0.1.8 - 1.1s - 0.0s (1%) - - - - - 197. - scheduled-thread-pool v0.2.5 - 1.1s - 0.7s (65%) - - - - - 198. - humantime v2.0.1 - 1.1s - 0.4s (40%) - - - - - 199. + 189. pq-sys v0.4.6 custom-build 1.1s 0.0s (0%) @@ -1772,47 +1692,111 @@ h1 { - 200. - serde_urlencoded v0.7.0 + 190. + crc32fast v1.2.1 1.1s - 0.1s (10%) + 0.4s (38%) + default, std + + + + 191. + byteorder v1.3.4 + 1.1s + 0.2s (22%) + default, std + + + + 192. + mime v0.3.16 + 1.1s + 0.5s (45%) - 201. - log v0.4.11 + 193. + base64 v0.12.3 1.1s - 0.4s (36%) - std + 0.4s (33%) + default, std - 202. - quote v1.0.7 + 194. + ppv-lite86 v0.2.10 + 1.1s + 0.0s (4%) + simd, std + + + + 195. + ryu v1.0.5 1.1s 0.5s (47%) + + + + + 196. + miniz_oxide v0.4.3 custom-build (run) + 1.1s + 0.0s (0%) + no_extern_crate_alloc + + + + 197. + actix-connect v2.0.0 + 1.1s + 0.2s (22%) + default, http, rust-tls, rustls, tokio-rustls, uri, webpki + + + + 198. + unicase v2.6.0 + 1.0s + 0.4s (43%) + + + + + 199. + pem v0.8.2 + 1.0s + 0.6s (55%) + + + + + 200. + proc-macro2 v1.0.24 custom-build + 1.0s + 0.0s (0%) default, proc-macro - 203. - const_fn v0.4.4 custom-build - 1.1s - 0.0s (0%) - - - - - 204. - parking_lot_core v0.8.1 + 201. + want v0.3.0 1.0s - 0.5s (44%) + 0.5s (53%) - 205. + 202. + lemmy_rate_limit v0.1.0 + 1.0s + 0.2s (16%) + + + + + 203. generic-array v0.14.4 1.0s 0.0s (3%) @@ -1820,63 +1804,127 @@ h1 { - 206. - lemmy_rate_limit v0.1.0 + 204. + const_fn v0.4.4 custom-build 1.0s - 0.2s (17%) + 0.0s (0%) + + + + + 205. + scheduled-thread-pool v0.2.5 + 1.0s + 0.6s (59%) + + + + + 206. + humantime v2.0.1 + 1.0s + 0.4s (42%) 207. - sha-1 v0.9.2 + num-iter v0.1.42 custom-build (run) 1.0s - 0.5s (45%) + 0.0s (0%) default, std 208. - thread_local v1.0.1 + num-bigint v0.2.6 custom-build (run) 1.0s - 0.4s (43%) - + 0.0s (0%) + default, std 209. - activitystreams-ext v0.1.0-alpha.2 - 1.0s - 0.1s (6%) - + standback v0.2.13 custom-build (run) + 0.9s + 0.0s (0%) + std 210. - syn v1.0.54 custom-build - 1.0s + num-rational v0.3.2 custom-build (run) + 0.9s 0.0s (0%) - clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut + 211. - twoway v0.2.1 - 1.0s - 0.4s (41%) - default, use_std + getrandom v0.1.15 + 0.9s + 0.4s (38%) + std 212. - http-signature-normalization-reqwest v0.1.3 - 1.0s - 0.1s (14%) - base64, digest, sha-2, sha2, tokio + actix-utils v2.0.0 + 0.9s + 0.2s (25%) + 213. + hound v3.4.0 + 0.9s + 0.2s (21%) + + + + + 214. + serde_urlencoded v0.7.0 + 0.9s + 0.2s (17%) + + + + + 215. + maybe-uninit v2.0.0 custom-build + 0.9s + 0.0s (0%) + + + + + 216. + pq-sys v0.4.6 + 0.9s + 0.3s (36%) + + + + + 217. + actix-web-actors v3.0.0 + 0.9s + 0.1s (13%) + + + + + 218. + num-traits v0.2.14 custom-build (run) + 0.9s + 0.0s (0%) + default, i128, std + + + + 219. libc v0.2.81 custom-build 0.9s 0.0s (0%) @@ -1884,136 +1932,88 @@ h1 { - 214. - byteorder v1.3.4 + 220. + color_quant v1.1.0 0.9s - 0.2s (17%) - default, std + 0.5s (53%) + - 215. - serde_derive v1.0.118 custom-build + 221. + pin-project-internal v0.4.27 custom-build 0.9s 0.0s (0%) + + + + + 222. + serde_json v1.0.60 custom-build + 0.9s + 0.0s (0%) + default, indexmap, preserve_order, std + + + + 223. + hostname v0.3.1 + 0.9s + 0.4s (50%) default - 216. + 224. serde v1.0.118 custom-build 0.9s 0.0s (0%) default, derive, serde_derive, std - - 217. - color_quant v1.1.0 - 0.9s - 0.5s (58%) - - - - - 218. - hound v3.4.0 - 0.9s - 0.3s (29%) - - - - - 219. - proc-macro2 v1.0.24 custom-build - 0.9s - 0.0s (0%) - default, proc-macro - - - - 220. - httpdate v0.3.2 - 0.9s - 0.4s (42%) - - - - - 221. - anyhow v1.0.35 custom-build - 0.9s - 0.0s (0%) - default, std - - - - 222. - native-tls v0.2.6 - 0.9s - 0.3s (38%) - - - - - 223. - bcrypt v0.9.0 - 0.9s - 0.4s (44%) - default, std - - - - 224. - unicase v2.6.0 custom-build (run) - 0.9s - 0.0s (0%) - - - 225. - proc-macro-hack v0.5.19 custom-build - 0.8s + syn v1.0.54 custom-build + 0.9s 0.0s (0%) - + clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut 226. - brotli2 v0.3.2 + ryu v1.0.5 custom-build 0.8s - 0.3s (33%) + 0.0s (0%) 227. - maybe-uninit v2.0.0 custom-build + sha-1 v0.9.2 0.8s - 0.0s (0%) - + 0.4s (47%) + default, std 228. - quoted_printable v0.4.2 + crc32fast v1.2.1 custom-build 0.8s - 0.4s (44%) - + 0.0s (0%) + default, std 229. - crc32fast v1.2.1 + anyhow v1.0.35 custom-build 0.8s - 0.3s (38%) + 0.0s (0%) default, std 230. - radium v0.5.3 custom-build + rayon v1.5.0 custom-build (run) 0.8s 0.0s (0%) @@ -2021,150 +2021,174 @@ h1 { 231. - addr2line v0.14.0 + heck v0.3.1 0.8s - 0.2s (23%) + 0.4s (48%) 232. - futures-channel v0.3.8 + iovec v0.1.4 0.8s - 0.1s (14%) - alloc, default, futures-sink, sink, std + 0.3s (37%) + 233. - getrandom v0.1.15 custom-build + getrandom v0.2.0 0.8s - 0.0s (0%) + 0.3s (35%) std 234. - tracing v0.1.22 + background-jobs-actix v0.8.0 0.8s - 0.3s (39%) - log, std + 0.2s (22%) + 235. - once_cell v1.5.2 + quoted_printable v0.4.2 0.8s - 0.2s (24%) - alloc, default, std + 0.4s (54%) + 236. - lock_api v0.4.2 + indexmap v1.6.1 custom-build (run) 0.8s - 0.0s (4%) + 0.0s (0%) 237. - futures-task v0.3.8 + proc-macro-hack v0.5.19 custom-build 0.8s - 0.2s (20%) - alloc, once_cell, std + 0.0s (0%) + 238. - entities v1.0.1 + event-listener v2.5.1 0.8s - 0.1s (18%) + 0.4s (50%) 239. - unicase v2.6.0 + httpdate v0.3.2 0.8s - 0.3s (35%) + 0.4s (48%) 240. - pq-sys v0.4.6 + percent-encoding v2.1.0 0.8s - 0.2s (31%) + 0.4s (49%) 241. - heck v0.3.1 - 0.7s - 0.4s (52%) + thread_local v1.0.1 + 0.8s + 0.3s (41%) 242. - iovec v0.1.4 - 0.7s - 0.3s (43%) - + serde_derive v1.0.118 custom-build + 0.8s + 0.0s (0%) + default 243. - radium v0.5.3 - 0.7s - 0.1s (7%) - + bitflags v1.2.1 custom-build + 0.8s + 0.0s (0%) + default 244. - num-traits v0.2.14 custom-build (run) + activitystreams-ext v0.1.0-alpha.2 0.7s - 0.0s (0%) - default, i128, std - - - - 245. - log v0.4.11 custom-build - 0.7s - 0.0s (0%) - std - - - - 246. - standback v0.2.13 custom-build - 0.7s - 0.0s (0%) - std - - - - 247. - num-rational v0.3.2 custom-build (run) - 0.7s - 0.0s (0%) + 0.0s (2%) - 248. - event-listener v2.5.1 + 245. + futures-channel v0.3.8 0.7s - 0.3s (48%) + 0.1s (9%) + alloc, default, futures-sink, sink, std + + + + 246. + migrations_macros v1.4.2 + 0.7s + 0.0s (0%) + default + + + + 247. + rand_core v0.5.1 + 0.7s + 0.2s (30%) + alloc, getrandom, std + + + + 248. + entities v1.0.1 + 0.7s + 0.1s (20%) 249. + proc-macro-nested v0.1.6 custom-build + 0.7s + 0.0s (0%) + + + + + 250. + radium v0.5.3 + 0.7s + 0.1s (8%) + + + + + 251. + time v0.2.23 custom-build (run) + 0.7s + 0.0s (0%) + libc, std, stdweb, winapi + + + + 252. memchr v2.3.4 custom-build 0.7s 0.0s (0%) @@ -2172,175 +2196,119 @@ h1 { - 250. - spin v0.5.2 - 0.7s - 0.0s (2%) - - - - - 251. - ryu v1.0.5 - 0.7s - 0.2s (35%) - - - - - 252. - num-iter v0.1.42 custom-build (run) + 253. + openssl-sys v0.9.59 custom-build (run) 0.7s 0.0s (0%) - default, std - - - - 253. - actix-tls v2.0.0 - 0.7s - 0.2s (31%) - default, rust-tls, rustls, tokio-rustls, webpki, webpki-roots + 254. - rayon v1.5.0 custom-build (run) + nom v6.0.1 custom-build (run) 0.7s 0.0s (0%) - + alloc, bitvec 255. - migrations_internals v1.4.1 - 0.7s - 0.1s (19%) - default - - - - 256. - openssl v0.10.31 custom-build + radium v0.5.3 custom-build 0.7s 0.0s (0%) - 257. - rand_core v0.5.1 + 256. + linked-hash-map v0.3.0 0.7s - 0.2s (25%) - alloc, getrandom, std + 0.0s (5%) + serde, serde_impl, serde_test + + + + 257. + futures-io v0.3.8 + 0.7s + 0.3s (44%) + default, std 258. - r2d2 v0.8.9 + smallvec v1.5.1 0.7s - 0.1s (16%) + 0.1s (9%) 259. - getrandom v0.2.0 custom-build - 0.7s - 0.0s (0%) - std + unicode_categories v0.1.1 + 0.6s + 0.1s (14%) + 260. - futures-executor v0.3.8 - 0.7s - 0.2s (37%) - std + r2d2 v0.8.9 + 0.6s + 0.1s (13%) + 261. - getrandom v0.1.15 - 0.7s - 0.2s (35%) + getrandom v0.2.0 custom-build + 0.6s + 0.0s (0%) std 262. - openssl-probe v0.1.2 - 0.7s - 0.3s (53%) + http-body v0.3.1 + 0.6s + 0.1s (15%) 263. - actix-codec v0.3.0 - 0.7s - 0.1s (11%) - - - - - 264. - getrandom v0.2.0 + getrandom v0.1.15 custom-build 0.6s - 0.2s (34%) + 0.0s (0%) std - 265. - unicode_categories v0.1.1 + 264. + bytestring v0.1.5 0.6s - 0.1s (11%) + 0.2s (36%) + + + + + 265. + mio-uds v0.6.8 + 0.6s + 0.2s (33%) 266. - shell-words v1.0.0 + once_cell v1.5.2 0.6s - 0.3s (44%) - + 0.2s (34%) + alloc, default, std 267. - num-bigint v0.2.6 custom-build - 0.6s - 0.0s (0%) - default, std - - - - 268. - futures-io v0.3.8 - 0.6s - 0.3s (47%) - default, std - - - - 269. - indexmap v1.6.1 custom-build (run) - 0.6s - 0.0s (0%) - - - - - 270. - miniz_oxide v0.4.3 custom-build (run) - 0.6s - 0.0s (0%) - no_extern_crate_alloc - - - - 271. time v0.2.23 custom-build 0.6s 0.0s (0%) @@ -2348,47 +2316,23 @@ h1 { - 272. - sct v0.6.0 + 268. + openssl-probe v0.1.2 0.6s - 0.2s (32%) + 0.3s (54%) - 273. - num-bigint v0.2.6 custom-build (run) + 269. + lock_api v0.4.2 0.6s - 0.0s (0%) - default, std - - - - 274. - generic-array v0.14.4 custom-build - 0.6s - 0.0s (0%) + 0.0s (8%) - 275. - futures-core v0.3.8 - 0.6s - 0.2s (29%) - alloc, default, std - - - - 276. - form_urlencoded v1.0.0 - 0.6s - 0.2s (35%) - - - - - 277. + 270. brotli-sys v0.3.2 custom-build 0.6s 0.0s (0%) @@ -2396,239 +2340,111 @@ h1 { - 278. - unicase v2.6.0 custom-build + 271. + num-bigint v0.2.6 custom-build + 0.6s + 0.0s (0%) + default, std + + + + 272. + shell-words v1.0.0 + 0.6s + 0.3s (46%) + + + + + 273. + openssl v0.10.31 custom-build 0.6s 0.0s (0%) - 279. - crossbeam-deque v0.8.0 - 0.6s - 0.0s (5%) - crossbeam-epoch, crossbeam-utils, default, std - - - - 280. - either v1.6.1 - 0.6s - 0.0s (2%) - default, use_std - - - - 281. - linked-hash-map v0.5.3 - 0.6s - 0.0s (3%) - - - - - 282. - crossbeam-utils v0.8.1 custom-build - 0.6s - 0.0s (0%) - default, lazy_static, std - - - - 283. - mio-uds v0.6.8 - 0.6s - 0.2s (29%) - - - - - 284. - hostname v0.3.1 - 0.5s - 0.2s (44%) - default - - - - 285. - num-integer v0.1.44 custom-build - 0.5s - 0.0s (0%) - i128, std - - - - 286. - num-traits v0.2.14 custom-build - 0.5s - 0.0s (0%) - default, i128, std - - - - 287. - actix-testing v1.0.1 - 0.5s - 0.1s (19%) - - - - - 288. + 274. tokio-rustls v0.14.1 - 0.5s - 0.0s (7%) + 0.6s + 0.1s (13%) - 289. - v_htmlescape v0.11.0 custom-build - 0.5s - 0.0s (0%) - bytes-buf, default - - - - 290. - native-tls v0.2.6 custom-build - 0.5s - 0.0s (0%) - - - - - 291. - slab v0.4.2 - 0.5s - 0.0s (3%) - - - - - 292. - blowfish v0.7.0 - 0.5s - 0.1s (18%) - bcrypt - - - - 293. - bytestring v0.1.5 - 0.5s - 0.1s (29%) - - - - - 294. - crossbeam-utils v0.7.2 custom-build - 0.5s - 0.0s (0%) - default, lazy_static, std - - - - 295. + 275. rayon v1.5.0 custom-build - 0.5s + 0.6s 0.0s (0%) - 296. - linked-hash-map v0.3.0 - 0.5s - 0.0s (4%) - serde, serde_impl, serde_test - - - - 297. - cipher v0.2.5 - 0.5s - 0.0s (4%) - - - - - 298. - miniz_oxide v0.4.3 custom-build - 0.5s - 0.0s (0%) - no_extern_crate_alloc - - - - 299. - wyz v0.2.0 - 0.5s - 0.0s (3%) - alloc - - - - 300. - untrusted v0.7.1 - 0.5s - 0.1s (11%) - - - - - 301. - openssl-sys v0.9.59 custom-build (run) - 0.5s - 0.0s (0%) - - - - - 302. - adler v0.2.3 - 0.5s - 0.1s (30%) - - - - - 303. - want v0.3.0 - 0.5s - 0.2s (32%) - - - - - 304. - nom v5.1.2 custom-build - 0.5s - 0.0s (0%) - alloc, default, lexical, lexical-core, std - - - - 305. - memoffset v0.6.1 custom-build - 0.5s - 0.0s (0%) - default - - - - 306. - actix-threadpool v0.3.3 - 0.5s + 276. + form_urlencoded v1.0.0 + 0.6s 0.2s (33%) - 307. + 277. + crossbeam-utils v0.7.2 custom-build + 0.6s + 0.0s (0%) + default, lazy_static, std + + + + 278. + futures-task v0.3.8 + 0.6s + 0.2s (33%) + alloc, once_cell, std + + + + 279. + standback v0.2.13 custom-build + 0.6s + 0.0s (0%) + std + + + + 280. + futures-executor v0.3.8 + 0.6s + 0.2s (30%) + std + + + + 281. + log v0.4.11 custom-build + 0.5s + 0.0s (0%) + std + + + + 282. + actix-codec v0.3.0 + 0.5s + 0.1s (9%) + + + + + 283. + memoffset v0.6.1 custom-build (run) + 0.5s + 0.0s (0%) + default + + + + 284. nom v6.0.1 custom-build 0.5s 0.0s (0%) @@ -2636,119 +2452,279 @@ h1 { - 308. - cookie v0.14.3 custom-build + 285. + crossbeam-deque v0.8.0 + 0.5s + 0.0s (4%) + crossbeam-epoch, crossbeam-utils, default, std + + + + 286. + adler v0.2.3 + 0.5s + 0.2s (39%) + + + + + 287. + native-tls v0.2.6 custom-build 0.5s 0.0s (0%) - percent-encode, percent-encoding + + + + + 288. + num-rational v0.3.2 custom-build + 0.5s + 0.0s (0%) + + + + + 289. + futures-core v0.3.8 + 0.5s + 0.2s (38%) + alloc, default, std + + + + 290. + num-integer v0.1.44 custom-build + 0.5s + 0.0s (0%) + i128, std + + + + 291. + tokio v0.3.6 custom-build (run) + 0.5s + 0.0s (0%) + default, sync + + + + 292. + num-traits v0.2.14 custom-build + 0.5s + 0.0s (0%) + default, i128, std + + + + 293. + crossbeam-utils v0.8.1 custom-build + 0.5s + 0.0s (0%) + default, lazy_static, std + + + + 294. + migrations_internals v1.4.1 + 0.5s + 0.1s (20%) + default + + + + 295. + cipher v0.2.5 + 0.5s + 0.0s (8%) + + + + + 296. + adler32 v1.2.0 + 0.5s + 0.2s (32%) + default, std + + + + 297. + linked-hash-map v0.5.3 + 0.5s + 0.0s (3%) + + + + + 298. + v_htmlescape v0.11.0 custom-build + 0.5s + 0.0s (0%) + bytes-buf, default + + + + 299. + v_escape v0.14.1 custom-build + 0.5s + 0.0s (0%) + bytes-buf + + + + 300. + miniz_oxide v0.4.3 custom-build + 0.5s + 0.0s (0%) + no_extern_crate_alloc + + + + 301. + memoffset v0.6.1 custom-build + 0.5s + 0.0s (0%) + default + + + + 302. + num-iter v0.1.42 custom-build + 0.5s + 0.0s (0%) + default, std + + + + 303. + unicase v2.6.0 custom-build + 0.5s + 0.0s (0%) + + + + + 304. + tokio v0.3.6 custom-build + 0.5s + 0.0s (0%) + default, sync + + + + 305. + blowfish v0.7.0 + 0.5s + 0.1s (22%) + bcrypt + + + + 306. + either v1.6.1 + 0.5s + 0.0s (7%) + default, use_std + + + + 307. + encoding_rs v0.8.26 custom-build + 0.5s + 0.0s (0%) + + + + + 308. + nom v4.2.3 custom-build + 0.5s + 0.0s (0%) + alloc, default, std 309. - indexmap v1.6.1 custom-build - 0.5s + generic-array v0.14.4 custom-build + 0.4s 0.0s (0%) 310. - num-iter v0.1.42 + lru-cache v0.1.2 0.4s 0.0s (3%) - default, std - - - - 311. - tokio v0.3.6 custom-build - 0.4s - 0.0s (0%) - default, sync - - - - 312. - thiserror v1.0.22 - 0.4s - 0.1s (28%) - 313. - num-rational v0.3.2 custom-build + 311. + indexmap v1.6.1 custom-build 0.4s 0.0s (0%) + + 312. + cookie v0.14.3 custom-build + 0.4s + 0.0s (0%) + percent-encode, percent-encoding + + + + 313. + untrusted v0.7.1 + 0.4s + 0.1s (27%) + + + 314. - tokio v0.3.6 custom-build (run) + tokio-tls v0.3.1 0.4s - 0.0s (0%) - default, sync + 0.1s (12%) + 315. - tokio-tls v0.3.1 - 0.4s - 0.0s (9%) - - - - - 316. - adler32 v1.2.0 - 0.4s - 0.1s (33%) - default, std - - - - 317. - bytemuck v1.4.1 - 0.4s - 0.0s (9%) - - - - - 318. - memoffset v0.6.1 custom-build (run) - 0.4s - 0.0s (0%) - default - - - - 319. - standback v0.2.13 custom-build (run) - 0.4s - 0.0s (0%) - std - - - - 320. - num-iter v0.1.42 custom-build - 0.4s - 0.0s (0%) - default, std - - - - 321. buf-min v0.2.0 0.4s - 0.0s (5%) + 0.0s (11%) bytes, bytes-buf - 322. + 316. + bytemuck v1.4.1 + 0.4s + 0.0s (8%) + + + + + 317. + wyz v0.2.0 + 0.4s + 0.0s (9%) + alloc + + + + 318. + actix-threadpool v0.3.3 + 0.4s + 0.1s (19%) + + + + + 319. itoa v0.4.6 0.4s 0.0s (5%) @@ -2756,15 +2732,23 @@ h1 { - 323. - nom v4.2.3 custom-build + 320. + nom v5.1.2 custom-build 0.4s 0.0s (0%) - alloc, default, std + alloc, default, lexical, lexical-core, std - 324. + 321. + ident_case v1.0.1 + 0.4s + 0.1s (24%) + + + + + 322. derive_builder v0.9.0 custom-build 0.4s 0.0s (0%) @@ -2772,71 +2756,15 @@ h1 { - 325. - lexical-core v0.7.4 custom-build + 323. + proc-macro-nested v0.1.6 0.4s - 0.0s (0%) - arrayvec, correct, default, ryu, static_assertions, std, table - - - - 326. - rayon-core v1.9.0 custom-build - 0.4s - 0.0s (0%) + 0.0s (6%) - 327. - v_escape v0.14.1 custom-build - 0.4s - 0.0s (0%) - bytes-buf - - - - 328. - ident_case v1.0.1 - 0.4s - 0.1s (17%) - - - - - 329. - unchecked-index v0.2.2 - 0.4s - 0.0s (9%) - - - - - 330. - static_assertions v1.1.0 - 0.4s - 0.0s (4%) - - - - - 331. - http-body v0.3.1 - 0.4s - 0.0s (10%) - - - - - 332. - typed-arena v1.7.0 - 0.4s - 0.0s (4%) - default, std - - - - 333. + 324. anyhow v1.0.35 custom-build (run) 0.4s 0.0s (0%) @@ -2844,191 +2772,247 @@ h1 { - 334. - tracing-futures v0.2.4 + 325. + http-signature-normalization-reqwest v0.1.3 0.4s - 0.0s (6%) - pin-project, std-future + 0.1s (19%) + base64, digest, sha-2, sha2, tokio - 335. - fxhash v0.2.1 + 326. + spin v0.5.2 0.4s - 0.1s (19%) + 0.0s (11%) - 336. - async-mutex v1.4.0 - 0.3s + 327. + atty v0.2.14 + 0.4s + 0.1s (14%) + + + + + 328. + brotli-sys v0.3.2 + 0.4s + 0.0s (10%) + + + + + 329. + rayon-core v1.9.0 custom-build + 0.4s + 0.0s (0%) + + + + + 330. + slab v0.4.2 + 0.4s 0.0s (7%) - 337. - unicode-xid v0.2.1 - 0.3s - 0.1s (19%) + 331. + lexical-core v0.7.4 custom-build + 0.4s + 0.0s (0%) + arrayvec, correct, default, ryu, static_assertions, std, table + + + + 332. + bitflags v1.2.1 + 0.4s + 0.0s (12%) default - 338. - lru-cache v0.1.2 - 0.3s - 0.0s (3%) + 333. + unicode-xid v0.2.1 + 0.4s + 0.1s (15%) + default + + + + 334. + thiserror v1.0.22 + 0.4s + 0.0s (11%) + + 335. + generic-array v0.14.4 custom-build (run) + 0.4s + 0.0s (0%) + + + + + 336. + fxhash v0.2.1 + 0.3s + 0.1s (20%) + + + + + 337. + hyper-tls v0.4.3 + 0.3s + 0.0s (11%) + + + + + 338. + actix-tls v2.0.0 + 0.3s + 0.1s (17%) + default, rust-tls, rustls, tokio-rustls, webpki, webpki-roots + + 339. digest v0.9.0 0.3s - 0.0s (7%) + 0.0s (8%) alloc, std 340. - scopeguard v1.1.0 + async-mutex v1.4.0 0.3s - 0.0s (9%) + 0.0s (5%) 341. - lazy_static v1.4.0 + block-buffer v0.9.0 + 0.3s + 0.0s (5%) + + + + + 342. + typed-arena v1.7.0 + 0.3s + 0.0s (6%) + default, std + + + + 343. + strum v0.20.0 0.3s 0.0s (12%) - - 342. - background-jobs v0.8.0 - 0.3s - 0.0s (4%) - background-jobs-actix, default - - - - 343. - futures v0.3.8 - 0.3s - 0.0s (7%) - alloc, async-await, default, executor, futures-executor, std - - 344. - strum v0.20.0 + tap v1.0.0 0.3s - 0.0s (10%) + 0.0s (11%) 345. - block-buffer v0.9.0 - 0.3s - 0.0s (14%) - - - - - 346. - atty v0.2.14 - 0.3s - 0.0s (8%) - - - - - 347. - proc-macro-nested v0.1.6 - 0.3s - 0.0s (6%) - - - - - 348. - hyper-tls v0.4.3 + unchecked-index v0.2.2 0.3s 0.0s (9%) - 349. + 346. + num-iter v0.1.42 + 0.3s + 0.0s (6%) + default, std + + + + 347. webpki-roots v0.20.0 0.3s - 0.0s (7%) + 0.0s (11%) + + + + + 348. + standback v0.2.13 + 0.3s + 0.1s (18%) + std + + + + 349. + copyless v0.1.5 + 0.3s + 0.0s (6%) 350. - memoffset v0.6.1 + futures-sink v0.3.8 0.3s - 0.0s (5%) - default + 0.0s (11%) + alloc, default, std 351. - darling v0.10.2 + quick-error v1.2.3 0.3s - 0.0s (6%) - default, suggestions + 0.0s (11%) + 352. - tap v1.0.0 + maplit v1.0.2 0.3s - 0.0s (6%) + 0.0s (15%) 353. - cpuid-bool v0.1.2 + tracing-futures v0.2.4 0.3s - 0.0s (12%) - + 0.0s (5%) + pin-project, std-future 354. - fnv v1.0.7 + v_escape v0.14.1 0.3s - 0.0s (5%) - default, std + 0.0s (14%) + bytes-buf 355. - instant v0.1.9 - 0.3s - 0.0s (17%) - - - - - 356. - futures-sink v0.3.8 - 0.3s - 0.0s (5%) - alloc, default, std - - - - 357. cookie v0.14.3 custom-build (run) 0.3s 0.0s (0%) @@ -3036,127 +3020,87 @@ h1 { - 358. - quick-error v1.2.3 + 356. + fnv v1.0.7 0.3s - 0.0s (7%) + 0.0s (15%) + default, std + + + + 357. + actix-testing v1.0.1 + 0.3s + 0.0s (16%) + + + + + 358. + scopeguard v1.1.0 + 0.3s + 0.0s (9%) 359. - try-lock v0.2.3 + lazy_static v1.4.0 0.3s - 0.0s (7%) + 0.0s (13%) 360. - bitflags v1.2.1 + cpuid-bool v0.1.2 0.3s - 0.0s (8%) - default + 0.0s (15%) + 361. - tower-service v0.3.0 - 0.3s + futures v0.3.8 + 0.2s 0.0s (4%) - + alloc, async-await, default, executor, futures-executor, std 362. - pin-project v0.4.27 - 0.3s - 0.0s (5%) - + background-jobs v0.8.0 + 0.2s + 0.0s (4%) + background-jobs-actix, default 363. - match_cfg v0.1.0 - 0.2s - 0.0s (14%) - default, use_core - - - - 364. - copyless v0.1.5 - 0.2s - 0.0s (5%) - - - - - 365. - cfg-if v0.1.10 - 0.2s - 0.0s (8%) - - - - - 366. - num-traits v0.1.43 - 0.2s - 0.0s (4%) - - - - - 367. - pin-utils v0.1.0 - 0.2s - 0.0s (4%) - - - - - 368. - maybe-uninit v2.0.0 + pin-project v1.0.2 0.2s 0.0s (6%) - 369. - nom v6.0.1 custom-build (run) + 364. + memoffset v0.6.1 0.2s - 0.0s (0%) - alloc, bitvec + 0.0s (15%) + default - 370. - brotli-sys v0.3.2 + 365. + pin-project v0.4.27 0.2s - 0.0s (7%) + 0.0s (10%) - 371. - crc32fast v1.2.1 custom-build (run) - 0.2s - 0.0s (0%) - default, std - - - - 372. - standback v0.2.13 - 0.2s - 0.0s (8%) - std - - - - 373. + 366. nom v4.2.3 custom-build (run) 0.2s 0.0s (0%) @@ -3164,47 +3108,15 @@ h1 { - 374. - maplit v1.0.2 - 0.2s - 0.0s (5%) - - - - - 375. - foreign-types v0.3.2 - 0.2s - 0.0s (7%) - - - - - 376. - cfg-if v1.0.0 - 0.2s - 0.0s (8%) - - - - - 377. - serde_derive v1.0.118 custom-build (run) + 367. + crc32fast v1.2.1 custom-build (run) 0.2s 0.0s (0%) - default + default, std - 378. - opaque-debug v0.3.0 - 0.2s - 0.0s (9%) - - - - - 379. + 368. nom v5.1.2 custom-build (run) 0.2s 0.0s (0%) @@ -3212,143 +3124,55 @@ h1 { - 380. - proc-macro2 v1.0.24 custom-build (run) + 369. + match_cfg v0.1.0 0.2s - 0.0s (0%) - default, proc-macro + 0.0s (8%) + default, use_core - 381. - tinyvec_macros v0.1.0 - 0.2s - 0.0s (7%) - - - - - 382. - foreign-types-shared v0.1.1 - 0.2s - 0.0s (9%) - - - - - 383. + 370. pin-project-lite v0.1.11 0.2s - 0.0s (4%) + 0.0s (10%) - 384. - generic-array v0.14.4 custom-build (run) + 371. + foreign-types-shared v0.1.1 0.2s - 0.0s (0%) + 0.0s (8%) - 385. - serde v1.0.118 custom-build (run) + 372. + try-lock v0.2.3 0.2s - 0.0s (0%) - default, derive, serde_derive, std + 0.0s (10%) + - 386. - pin-project v1.0.2 + 373. + tinyvec_macros v0.1.0 + 0.2s + 0.0s (10%) + + + + + 374. + pin-project-lite v0.2.0 0.2s 0.0s (5%) - 387. - serde_json v1.0.60 custom-build (run) - 0.2s - 0.0s (0%) - default, indexmap, preserve_order, std - - - - 388. - time v0.2.23 custom-build (run) - 0.2s - 0.0s (0%) - libc, std, stdweb, winapi - - - - 389. - pin-project-internal v0.4.27 custom-build (run) - 0.2s - 0.0s (0%) - - - - - 390. - syn v1.0.54 custom-build (run) - 0.2s - 0.0s (0%) - clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut - - - - 391. - v_escape v0.14.1 - 0.2s - 0.0s (5%) - bytes-buf - - - - 392. - const_fn v0.4.4 custom-build (run) - 0.2s - 0.0s (0%) - - - - - 393. - bitflags v1.2.1 custom-build (run) - 0.2s - 0.0s (0%) - default - - - - 394. - time-macros v0.1.1 - 0.2s - 0.0s (6%) - - - - - 395. - diesel_migrations v1.4.0 - 0.2s - 0.0s (4%) - default - - - - 396. - ryu v1.0.5 custom-build (run) - 0.2s - 0.0s (0%) - - - - - 397. + 375. proc-macro-hack v0.5.19 custom-build (run) 0.2s 0.0s (0%) @@ -3356,31 +3180,79 @@ h1 { - 398. - byteorder v1.3.4 custom-build (run) + 376. + static_assertions v1.1.0 0.2s - 0.0s (0%) - default, std - - - - 399. - pin-project-lite v0.2.0 - 0.2s - 0.0s (4%) + 0.0s (5%) - 400. - pq-sys v0.4.6 custom-build (run) + 377. + darling v0.10.2 0.2s - 0.0s (0%) + 0.0s (9%) + default, suggestions + + + + 378. + maybe-uninit v2.0.0 + 0.2s + 0.0s (6%) - 401. + 379. + time-macros v0.1.1 + 0.2s + 0.0s (6%) + + + + + 380. + opaque-debug v0.3.0 + 0.2s + 0.0s (7%) + + + + + 381. + num-traits v0.1.43 + 0.2s + 0.0s (8%) + + + + + 382. + instant v0.1.9 + 0.2s + 0.0s (12%) + + + + + 383. + matches v0.1.8 + 0.2s + 0.0s (7%) + + + + + 384. + tower-service v0.3.0 + 0.2s + 0.0s (11%) + + + + + 385. httparse v1.3.4 custom-build (run) 0.2s 0.0s (0%) @@ -3388,15 +3260,103 @@ h1 { - 402. - libc v0.2.81 custom-build (run) + 386. + cfg-if v1.0.0 0.2s - 0.0s (0%) - align, default, std + 0.0s (3%) + - 403. + 387. + serde v1.0.118 custom-build (run) + 0.2s + 0.0s (0%) + default, derive, serde_derive, std + + + + 388. + pin-utils v0.1.0 + 0.2s + 0.0s (5%) + + + + + 389. + hyperx v1.2.0 custom-build (run) + 0.2s + 0.0s (0%) + headers + + + + 390. + serde_json v1.0.60 custom-build (run) + 0.2s + 0.0s (0%) + default, indexmap, preserve_order, std + + + + 391. + const_fn v0.4.4 custom-build (run) + 0.2s + 0.0s (0%) + + + + + 392. + serde_derive v1.0.118 custom-build (run) + 0.2s + 0.0s (0%) + default + + + + 393. + proc-macro2 v1.0.24 custom-build (run) + 0.2s + 0.0s (0%) + default, proc-macro + + + + 394. + ryu v1.0.5 custom-build (run) + 0.2s + 0.0s (0%) + + + + + 395. + foreign-types v0.3.2 + 0.2s + 0.0s (4%) + + + + + 396. + byteorder v1.3.4 custom-build (run) + 0.2s + 0.0s (0%) + default, std + + + + 397. + cfg-if v0.1.10 + 0.2s + 0.0s (4%) + + + + + 398. maybe-uninit v2.0.0 custom-build (run) 0.2s 0.0s (0%) @@ -3404,29 +3364,69 @@ h1 { - 404. - hyperx v1.2.0 custom-build (run) - 0.1s + 399. + bitflags v1.2.1 custom-build (run) + 0.2s 0.0s (0%) - headers + default - 405. - typenum v1.12.0 custom-build (run) - 0.1s + 400. + libc v0.2.81 custom-build (run) + 0.2s + 0.0s (0%) + align, default, std + + + + 401. + pin-project-internal v0.4.27 custom-build (run) + 0.2s 0.0s (0%) - 406. + 402. + syn v1.0.54 custom-build (run) + 0.2s + 0.0s (0%) + clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut + + + + 403. + typenum v1.12.0 custom-build (run) + 0.2s + 0.0s (0%) + + + + + 404. + diesel_migrations v1.4.0 + 0.1s + 0.0s (5%) + default + + + + 405. mime_guess v2.0.3 custom-build (run) 0.1s 0.0s (0%) default, rev-mappings + + 406. + num-integer v0.1.44 custom-build (run) + 0.0s + 0.0s (1%) + i128, std + + 407. proc-macro-nested v0.1.6 custom-build (run) @@ -3437,62 +3437,14 @@ h1 { 408. - encoding_rs v0.8.26 custom-build (run) + log v0.4.11 custom-build (run) 0.0s 0.0s (0%) - + std 409. - num-integer v0.1.44 custom-build (run) - 0.0s - 0.0s (0%) - i128, std - - - - 410. - radium v0.5.3 custom-build (run) - 0.0s - 0.0s (0%) - - - - - 411. - native-tls v0.2.6 custom-build (run) - 0.0s - 0.0s (0%) - - - - - 412. - v_htmlescape v0.11.0 custom-build (run) - 0.0s - 0.0s (0%) - bytes-buf, default - - - - 413. - memchr v2.3.4 custom-build (run) - 0.0s - 0.0s (1%) - default, std, use_std - - - - 414. - openssl v0.10.31 custom-build (run) - 0.0s - 0.0s (0%) - - - - - 415. getrandom v0.1.15 custom-build (run) 0.0s 0.0s (0%) @@ -3500,23 +3452,23 @@ h1 { - 416. - lexical-core v0.7.4 custom-build (run) + 410. + memchr v2.3.4 custom-build (run) 0.0s - 0.0s (1%) - arrayvec, correct, default, ryu, static_assertions, std, table + 0.0s (0%) + default, std, use_std - 417. - derive_builder v0.9.0 custom-build (run) + 411. + pq-sys v0.4.6 custom-build (run) 0.0s 0.0s (0%) - 418. + 412. v_escape v0.14.1 custom-build (run) 0.0s 0.0s (0%) @@ -3524,15 +3476,39 @@ h1 { - 419. - log v0.4.11 custom-build (run) + 413. + getrandom v0.2.0 custom-build (run) 0.0s - 0.0s (1%) + 0.0s (0%) std - 420. + 414. + radium v0.5.3 custom-build (run) + 0.0s + 0.0s (0%) + + + + + 415. + lexical-core v0.7.4 custom-build (run) + 0.0s + 0.0s (0%) + arrayvec, correct, default, ryu, static_assertions, std, table + + + + 416. + derive_builder v0.9.0 custom-build (run) + 0.0s + 0.0s (0%) + + + + + 417. rayon-core v1.9.0 custom-build (run) 0.0s 0.0s (0%) @@ -3540,16 +3516,40 @@ h1 { - 421. - getrandom v0.2.0 custom-build (run) + 418. + openssl v0.10.31 custom-build (run) 0.0s - 0.0s (1%) - std + 0.0s (0%) + + + + + 419. + v_htmlescape v0.11.0 custom-build (run) + 0.0s + 0.0s (0%) + bytes-buf, default + + + + 420. + encoding_rs v0.8.26 custom-build (run) + 0.0s + 0.0s (0%) + + + + + 421. + native-tls v0.2.6 custom-build (run) + 0.0s + 0.0s (0%) + - - diff --git a/cargo-timing-20201219T141946Z.html b/cargo-timing-20201219T141946Z.html deleted file mode 100644 index c14605108..000000000 --- a/cargo-timing-20201219T141946Z.html +++ /dev/null @@ -1,24104 +0,0 @@ - - - - Cargo Build Timings — lemmy_server 0.0.1 - - - - - -

Cargo Build Timings

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Targets:lemmy_server 0.0.1 (lib, bin "lemmy_server")
Profile:dev
Fresh units:0
Dirty units:421
Total units:421
Max concurrency:12 (jobs=12 ncpu=12)
Build start:2020-12-19T14:19:46Z
Total time:191.9s (3m 11.9s)
rustc:rustc 1.50.0-nightly (825637983 2020-11-18)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency:0
- - - - - - - - - - - - - - -
- -
- - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
UnitTotalCodegenFeatures
1.lemmy_db v0.1.045.2s6.9s (15%)
2.diesel v1.4.523.2s0.6s (2%)32-column-tables, bitflags, chrono, default, postgres, pq-sys, r2d2, serde_json, with-deprecated
3.syn v1.0.5419.5s7.8s (40%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
4.h2 v0.2.718.6s8.8s (47%)
5.lemmy_server v0.0.118.4s13.2s (72%)
6.serde_derive v1.0.11816.5s0.0s (0%)default
7.lemmy_server v0.0.1 bin "lemmy_server"15.8s0.0s (0%)
8.diesel_derives v1.4.114.2s0.0s (0%)default, postgres
9.hyper v0.13.914.2s0.8s (6%)socket2, tcp
10.derive_more v0.99.1114.1s0.0s (0%)add, add_assign, as_mut, as_ref, constructor, default, deref, deref_mut, display, error, from, from_str, index, index_mut, into, into_iterator, iterator, mul, mul_assign, not, sum, try_into
11.activitystreams v0.7.0-alpha.813.3s2.7s (20%)
12.trust-dns-proto v0.19.612.9s8.6s (66%)tokio, tokio-runtime
13.regex-syntax v0.6.2112.8s5.0s (39%)default, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment
14.image v0.23.1212.6s5.5s (44%)bmp, dds, default, dxt, farbfeld, gif, hdr, ico, jpeg, jpeg_rayon, png, pnm, scoped_threadpool, tga, tiff, webp
15.lettre v0.10.0-alpha.412.4s1.6s (13%)base64, builder, default, file-transport, hostname, hyperx, mime, native-tls, nom, quoted_printable, r2d2, rand, sendmail-transport, serde, serde_json, smtp-transport
16.pin-project-internal v0.4.2712.2s0.0s (0%)
17.async-trait v0.1.4211.9s0.0s (0%)
18.regex v1.4.211.5s8.6s (75%)aho-corasick, default, memchr, perf, perf-cache, perf-dfa, perf-inline, perf-literal, std, thread_local, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment
19.thiserror-impl v1.0.2211.2s0.0s (0%)
20.trust-dns-resolver v0.19.611.0s2.8s (25%)ipconfig, resolv-conf, system-config, tokio, tokio-runtime
21.rayon v1.5.010.5s0.8s (8%)
22.object v0.22.010.4s4.3s (41%)archive, coff, elf, macho, pe, read_core, unaligned
23.lemmy_api v0.1.010.2s4.7s (46%)
24.lemmy_apub v0.1.010.2s4.3s (42%)
25.tokio v0.2.2410.1s2.9s (29%)blocking, default, fnv, futures-core, io-driver, io-util, iovec, lazy_static, libc, memchr, mio, mio-uds, rt-core, rt-util, signal, signal-hook-registry, slab, stream, sync, tcp, time, udp, uds, winapi
26.lemmy_db_schema v0.1.09.6s0.8s (9%)
27.rustls v0.18.19.2s3.7s (40%)dangerous_configuration, default, log, logging
28.strum_macros v0.20.19.2s0.0s (0%)
29.darling_macro v0.10.28.5s0.0s (0%)
30.comrak v0.9.08.3s3.9s (47%)
31.openssl v0.10.318.2s2.8s (34%)
32.brotli-sys v0.3.2 custom-build (run)8.2s0.0s (0%)
33.actix_derive v0.5.08.2s0.0s (0%)
34.encoding_rs v0.8.267.7s3.8s (49%)
35.darling_core v0.10.27.7s2.3s (30%)strsim, suggestions
36.gimli v0.23.07.6s1.3s (17%)read
37.pin-project-internal v1.0.27.6s0.0s (0%)
38.futures-util v0.3.87.4s0.3s (4%)alloc, async-await, async-await-macro, channel, default, futures-channel, futures-io, futures-macro, futures-sink, io, memchr, proc-macro-hack, proc-macro-nested, sink, slab, std
39.rand v0.7.37.3s0.9s (12%)alloc, default, getrandom, getrandom_package, libc, std
40.rayon-core v1.9.07.1s5.5s (78%)
41.pest_generator v2.1.37.1s1.6s (23%)
42.http v0.2.27.0s1.9s (27%)
43.serde v1.0.1186.8s0.7s (11%)default, derive, serde_derive, std
44.ring v0.16.196.7s3.6s (53%)alloc, default, dev_urandom_fallback, once_cell, std
45.pest_meta v2.1.36.6s4.9s (75%)
46.hyperx v1.2.06.3s3.2s (50%)headers
47.actix-web v3.3.26.1s1.5s (25%)compress, default, rust-tls, rustls
48.cc v1.0.665.9s3.9s (66%)
49.actix-http v2.2.05.7s1.0s (19%)actix-tls, brotli2, compress, default, flate2, rustls
50.nom v6.0.15.6s0.5s (9%)alloc, bitvec
51.nom v5.1.25.4s0.8s (14%)alloc, default, lexical, lexical-core, std
52.serde v0.8.235.3s0.3s (6%)default, std
53.reqwest v0.10.105.3s3.3s (62%)__tls, default, default-tls, hyper-tls, json, native-tls-crate, serde_json, tokio-tls
54.time v0.2.235.3s2.2s (42%)libc, std, stdweb, winapi
55.backtrace v0.3.555.1s4.0s (79%)addr2line, default, gimli-symbolize, miniz_oxide, object, std
56.bitvec v0.19.44.9s0.1s (1%)alloc
57.aho-corasick v0.7.154.9s2.7s (56%)default, std
58.ryu v1.0.5 custom-build4.8s0.0s (0%)
59.num-bigint v0.2.64.8s1.4s (30%)default, std
60.lemmy_structs v0.1.04.7s0.4s (8%)
61.lodepng v3.2.24.7s2.8s (59%)default, rust_backend
62.awc v2.0.34.5s3.0s (66%)compress, rust-tls, rustls
63.derive_builder v0.9.04.2s0.0s (0%)
64.tiff v0.6.14.2s2.8s (67%)
65.lexical-core v0.7.44.1s0.3s (7%)arrayvec, correct, default, ryu, static_assertions, std, table
66.actix-server v1.0.44.1s2.2s (52%)default
67.jpeg-decoder v0.1.204.0s2.1s (52%)rayon
68.serde_json v1.0.603.9s0.8s (21%)default, indexmap, preserve_order, std
69.serde-hjson v0.9.13.8s2.2s (59%)default, linked-hash-map, preserve_order
70.v_escape_derive v0.8.43.8s0.0s (0%)
71.futures-macro v0.3.83.7s0.0s (0%)
72.pest v2.1.33.5s0.5s (13%)
73.chrono v0.4.193.4s0.4s (13%)clock, default, libc, oldtime, serde, std, time, winapi
74.tokio v0.3.63.3s1.4s (41%)default, sync
75.rand_chacha v0.2.23.2s2.2s (69%)std
76.proc-macro-hack v0.5.193.1s0.0s (0%)
77.lemmy_utils v0.1.03.1s0.6s (21%)
78.mio v0.6.233.1s1.4s (45%)default, with-deprecated
79.typenum v1.12.0 custom-build3.0s0.0s (0%)
80.miniz_oxide v0.3.73.0s1.4s (48%)
81.proc-macro2 v1.0.243.0s1.6s (53%)default, proc-macro
82.actix v0.10.03.0s0.3s (9%)default, resolver, trust-dns-proto, trust-dns-resolver
83.ring v0.16.19 custom-build (run)3.0s0.0s (0%)alloc, default, dev_urandom_fallback, once_cell, std
84.config v0.10.13.0s1.5s (49%)hjson, serde-hjson
85.actix-web-codegen v0.4.03.0s0.0s (0%)
86.base64 v0.13.02.9s0.3s (12%)default, std
87.itertools v0.9.02.9s0.5s (17%)default, use_std
88.url v2.2.02.8s0.8s (30%)serde
89.pkg-config v0.3.192.8s1.2s (44%)
90.rss v1.9.02.8s0.7s (24%)builders, default, derive_builder
91.unicode-segmentation v1.7.12.7s0.3s (12%)
92.nom v4.2.32.7s1.0s (36%)alloc, default, std
93.bytes v0.5.62.7s0.5s (18%)default, std
94.httparse v1.3.4 custom-build2.6s0.0s (0%)default, std
95.unicode-normalization v0.1.162.6s0.4s (16%)default, std
96.time-macros-impl v0.1.12.6s0.0s (0%)
97.deflate v0.8.62.6s1.3s (52%)
98.idna v0.2.02.6s1.2s (45%)
99.env_logger v0.8.22.5s1.1s (45%)atty, default, humantime, regex, termcolor
100.png v0.16.82.5s1.1s (43%)default, deflate, png-encoding
101.num-rational v0.3.22.5s1.4s (56%)
102.sha2 v0.9.22.4s0.8s (32%)default, std
103.base64 v0.12.32.3s0.4s (15%)default, std
104.actix-router v0.2.52.3s0.7s (30%)default, http
105.language-tags v0.2.22.3s1.7s (74%)
106.miniz_oxide v0.4.32.3s1.2s (51%)no_extern_crate_alloc
107.mime_guess v2.0.3 custom-build2.3s0.0s (0%)default, rev-mappings
108.crc32fast v1.2.1 custom-build2.2s0.0s (0%)default, std
109.num-traits v0.2.142.2s0.2s (8%)default, i128, std
110.tinyvec v1.1.02.2s0.0s (1%)alloc, default, tinyvec_macros
111.mime v0.3.162.2s1.7s (78%)
112.funty v1.0.12.2s1.0s (47%)
113.ipnet v2.3.02.2s1.2s (54%)
114.v_htmlescape v0.11.02.1s0.6s (28%)bytes-buf, default
115.background-jobs-core v0.8.02.1s0.5s (22%)actix-rt, default, tokio, with-actix
116.tracing-core v0.1.172.1s1.0s (51%)lazy_static, std
117.bytes v0.6.02.1s0.6s (31%)default, std
118.lemmy_websocket v0.1.02.0s0.7s (36%)
119.bitflags v1.2.1 custom-build2.0s0.0s (0%)default
120.typenum v1.12.02.0s0.1s (3%)
121.actix-rt v1.1.12.0s1.1s (55%)
122.unicode-bidi v0.3.42.0s1.1s (57%)default
123.migrations_macros v1.4.22.0s0.0s (0%)default
124.libc v0.2.811.9s0.2s (10%)align, default, std
125.encoding_rs v0.8.26 custom-build1.9s0.0s (0%)
126.actix-files v0.4.11.9s0.6s (32%)
127.byteorder v1.3.4 custom-build1.9s0.0s (0%)default, std
128.proc-macro-nested v0.1.6 custom-build1.9s0.0s (0%)
129.derive_builder_core v0.9.01.9s1.0s (54%)
130.enum-as-inner v0.3.31.9s0.0s (0%)
131.percent-encoding v2.1.01.8s0.2s (13%)
132.scoped_threadpool v0.1.91.8s1.4s (78%)
133.actix-utils v2.0.01.8s0.5s (28%)
134.gif v0.11.11.8s0.7s (37%)default, raii_no_panic, std
135.serde_json v1.0.60 custom-build1.8s0.0s (0%)default, indexmap, preserve_order, std
136.smallvec v1.5.11.8s0.0s (3%)
137.crossbeam-channel v0.5.01.8s0.6s (33%)crossbeam-utils, default, std
138.pin-project-internal v0.4.27 custom-build1.8s0.0s (0%)
139.ring v0.16.19 custom-build1.7s0.0s (0%)alloc, default, dev_urandom_fallback, once_cell, std
140.crossbeam-channel v0.4.41.7s0.5s (30%)
141.signal-hook-registry v1.2.21.7s1.0s (56%)
142.quick-xml v0.17.21.7s0.7s (43%)default, encoding, encoding_rs
143.cookie v0.14.31.7s1.0s (61%)percent-encode, percent-encoding
144.const_fn v0.4.41.7s0.0s (0%)
145.actix-macros v0.1.31.7s0.0s (0%)
146.weezl v0.1.31.7s0.9s (54%)alloc, default, std
147.time v0.1.441.7s0.7s (43%)
148.http-signature-normalization v0.5.31.6s0.9s (57%)
149.mime_guess v2.0.31.6s0.4s (27%)default, rev-mappings
150.openssl-sys v0.9.59 custom-build1.6s0.0s (0%)
151.pem v0.8.21.6s1.1s (70%)
152.hashbrown v0.9.11.6s0.1s (3%)raw
153.openssl-sys v0.9.591.6s0.2s (11%)
154.jsonwebtoken v7.2.01.6s0.5s (34%)
155.webpki v0.21.41.6s0.7s (44%)default, std, trust_anchor_util
156.crossbeam-utils v0.8.1 custom-build (run)1.5s0.0s (0%)default, lazy_static, std
157.resolv-conf v0.7.01.5s0.8s (51%)hostname, system
158.http-signature-normalization-actix v0.4.11.5s0.4s (28%)base64, digest, sha-2, sha2
159.crossbeam-utils v0.7.2 custom-build (run)1.5s0.0s (0%)default, lazy_static, std
160.flate2 v1.0.191.5s0.4s (27%)default, miniz_oxide, rust_backend
161.crossbeam-utils v0.8.11.5s0.7s (47%)default, lazy_static, std
162.actix-service v1.0.61.5s0.0s (3%)
163.rustc-demangle v0.1.181.5s0.7s (49%)
164.autocfg v1.0.11.5s0.9s (63%)
165.crossbeam-utils v0.7.21.5s0.7s (45%)default, lazy_static, std
166.arrayvec v0.5.21.4s0.0s (2%)array-sizes-33-128, default, std
167.pest_derive v2.1.01.4s0.0s (0%)
168.simple_asn1 v0.4.11.4s0.7s (51%)
169.version_check v0.9.21.4s0.8s (57%)
170.serde_test v0.8.231.4s0.2s (11%)
171.xdg v2.2.01.4s0.8s (59%)
172.parking_lot v0.11.11.4s0.8s (58%)default
173.num_cpus v1.13.01.4s0.9s (63%)
174.threadpool v1.8.11.4s1.0s (73%)
175.actix-web-actors v3.0.01.3s0.5s (38%)
176.termcolor v1.1.21.3s0.6s (45%)
177.socket2 v0.3.181.3s0.6s (48%)
178.anyhow v1.0.351.3s0.7s (53%)default, std
179.httparse v1.3.41.3s0.5s (41%)default, std
180.net2 v0.2.371.3s0.6s (50%)default, duration
181.captcha v0.0.81.2s0.5s (37%)
182.memchr v2.3.41.2s0.5s (40%)default, std, use_std
183.crossbeam-epoch v0.9.11.2s0.5s (40%)alloc, lazy_static, std
184.tokio-util v0.3.11.2s0.4s (28%)codec, compat, default, full, futures-io, udp
185.version_check v0.1.51.2s0.8s (65%)
186.strsim v0.9.31.2s0.8s (62%)
187.background-jobs-actix v0.8.01.2s0.3s (27%)
188.indexmap v1.6.11.2s0.1s (12%)
189.uuid v0.8.11.2s0.2s (21%)default, rand, serde, std, v4
190.actix-connect v2.0.01.2s0.3s (27%)default, http, rust-tls, rustls, tokio-rustls, uri, webpki
191.hyperx v1.2.0 custom-build1.2s0.0s (0%)headers
192.ppv-lite86 v0.2.101.1s0.0s (1%)simd, std
193.ucd-trie v0.1.31.1s0.7s (62%)default, std
194.rgb v0.8.251.1s0.0s (4%)as-bytes, bytemuck, default
195.num-integer v0.1.441.1s0.3s (30%)i128, std
196.matches v0.1.81.1s0.0s (1%)
197.scheduled-thread-pool v0.2.51.1s0.7s (65%)
198.humantime v2.0.11.1s0.4s (40%)
199.pq-sys v0.4.6 custom-build1.1s0.0s (0%)
200.serde_urlencoded v0.7.01.1s0.1s (10%)
201.log v0.4.111.1s0.4s (36%)std
202.quote v1.0.71.1s0.5s (47%)default, proc-macro
203.const_fn v0.4.4 custom-build1.1s0.0s (0%)
204.parking_lot_core v0.8.11.0s0.5s (44%)
205.generic-array v0.14.41.0s0.0s (3%)
206.lemmy_rate_limit v0.1.01.0s0.2s (17%)
207.sha-1 v0.9.21.0s0.5s (45%)default, std
208.thread_local v1.0.11.0s0.4s (43%)
209.activitystreams-ext v0.1.0-alpha.21.0s0.1s (6%)
210.syn v1.0.54 custom-build1.0s0.0s (0%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
211.twoway v0.2.11.0s0.4s (41%)default, use_std
212.http-signature-normalization-reqwest v0.1.31.0s0.1s (14%)base64, digest, sha-2, sha2, tokio
213.libc v0.2.81 custom-build0.9s0.0s (0%)align, default, std
214.byteorder v1.3.40.9s0.2s (17%)default, std
215.serde_derive v1.0.118 custom-build0.9s0.0s (0%)default
216.serde v1.0.118 custom-build0.9s0.0s (0%)default, derive, serde_derive, std
217.color_quant v1.1.00.9s0.5s (58%)
218.hound v3.4.00.9s0.3s (29%)
219.proc-macro2 v1.0.24 custom-build0.9s0.0s (0%)default, proc-macro
220.httpdate v0.3.20.9s0.4s (42%)
221.anyhow v1.0.35 custom-build0.9s0.0s (0%)default, std
222.native-tls v0.2.60.9s0.3s (38%)
223.bcrypt v0.9.00.9s0.4s (44%)default, std
224.unicase v2.6.0 custom-build (run)0.9s0.0s (0%)
225.proc-macro-hack v0.5.19 custom-build0.8s0.0s (0%)
226.brotli2 v0.3.20.8s0.3s (33%)
227.maybe-uninit v2.0.0 custom-build0.8s0.0s (0%)
228.quoted_printable v0.4.20.8s0.4s (44%)
229.crc32fast v1.2.10.8s0.3s (38%)default, std
230.radium v0.5.3 custom-build0.8s0.0s (0%)
231.addr2line v0.14.00.8s0.2s (23%)
232.futures-channel v0.3.80.8s0.1s (14%)alloc, default, futures-sink, sink, std
233.getrandom v0.1.15 custom-build0.8s0.0s (0%)std
234.tracing v0.1.220.8s0.3s (39%)log, std
235.once_cell v1.5.20.8s0.2s (24%)alloc, default, std
236.lock_api v0.4.20.8s0.0s (4%)
237.futures-task v0.3.80.8s0.2s (20%)alloc, once_cell, std
238.entities v1.0.10.8s0.1s (18%)
239.unicase v2.6.00.8s0.3s (35%)
240.pq-sys v0.4.60.8s0.2s (31%)
241.heck v0.3.10.7s0.4s (52%)
242.iovec v0.1.40.7s0.3s (43%)
243.radium v0.5.30.7s0.1s (7%)
244.num-traits v0.2.14 custom-build (run)0.7s0.0s (0%)default, i128, std
245.log v0.4.11 custom-build0.7s0.0s (0%)std
246.standback v0.2.13 custom-build0.7s0.0s (0%)std
247.num-rational v0.3.2 custom-build (run)0.7s0.0s (0%)
248.event-listener v2.5.10.7s0.3s (48%)
249.memchr v2.3.4 custom-build0.7s0.0s (0%)default, std, use_std
250.spin v0.5.20.7s0.0s (2%)
251.ryu v1.0.50.7s0.2s (35%)
252.num-iter v0.1.42 custom-build (run)0.7s0.0s (0%)default, std
253.actix-tls v2.0.00.7s0.2s (31%)default, rust-tls, rustls, tokio-rustls, webpki, webpki-roots
254.rayon v1.5.0 custom-build (run)0.7s0.0s (0%)
255.migrations_internals v1.4.10.7s0.1s (19%)default
256.openssl v0.10.31 custom-build0.7s0.0s (0%)
257.rand_core v0.5.10.7s0.2s (25%)alloc, getrandom, std
258.r2d2 v0.8.90.7s0.1s (16%)
259.getrandom v0.2.0 custom-build0.7s0.0s (0%)std
260.futures-executor v0.3.80.7s0.2s (37%)std
261.getrandom v0.1.150.7s0.2s (35%)std
262.openssl-probe v0.1.20.7s0.3s (53%)
263.actix-codec v0.3.00.7s0.1s (11%)
264.getrandom v0.2.00.6s0.2s (34%)std
265.unicode_categories v0.1.10.6s0.1s (11%)
266.shell-words v1.0.00.6s0.3s (44%)
267.num-bigint v0.2.6 custom-build0.6s0.0s (0%)default, std
268.futures-io v0.3.80.6s0.3s (47%)default, std
269.indexmap v1.6.1 custom-build (run)0.6s0.0s (0%)
270.miniz_oxide v0.4.3 custom-build (run)0.6s0.0s (0%)no_extern_crate_alloc
271.time v0.2.23 custom-build0.6s0.0s (0%)libc, std, stdweb, winapi
272.sct v0.6.00.6s0.2s (32%)
273.num-bigint v0.2.6 custom-build (run)0.6s0.0s (0%)default, std
274.generic-array v0.14.4 custom-build0.6s0.0s (0%)
275.futures-core v0.3.80.6s0.2s (29%)alloc, default, std
276.form_urlencoded v1.0.00.6s0.2s (35%)
277.brotli-sys v0.3.2 custom-build0.6s0.0s (0%)
278.unicase v2.6.0 custom-build0.6s0.0s (0%)
279.crossbeam-deque v0.8.00.6s0.0s (5%)crossbeam-epoch, crossbeam-utils, default, std
280.either v1.6.10.6s0.0s (2%)default, use_std
281.linked-hash-map v0.5.30.6s0.0s (3%)
282.crossbeam-utils v0.8.1 custom-build0.6s0.0s (0%)default, lazy_static, std
283.mio-uds v0.6.80.6s0.2s (29%)
284.hostname v0.3.10.5s0.2s (44%)default
285.num-integer v0.1.44 custom-build0.5s0.0s (0%)i128, std
286.num-traits v0.2.14 custom-build0.5s0.0s (0%)default, i128, std
287.actix-testing v1.0.10.5s0.1s (19%)
288.tokio-rustls v0.14.10.5s0.0s (7%)
289.v_htmlescape v0.11.0 custom-build0.5s0.0s (0%)bytes-buf, default
290.native-tls v0.2.6 custom-build0.5s0.0s (0%)
291.slab v0.4.20.5s0.0s (3%)
292.blowfish v0.7.00.5s0.1s (18%)bcrypt
293.bytestring v0.1.50.5s0.1s (29%)
294.crossbeam-utils v0.7.2 custom-build0.5s0.0s (0%)default, lazy_static, std
295.rayon v1.5.0 custom-build0.5s0.0s (0%)
296.linked-hash-map v0.3.00.5s0.0s (4%)serde, serde_impl, serde_test
297.cipher v0.2.50.5s0.0s (4%)
298.miniz_oxide v0.4.3 custom-build0.5s0.0s (0%)no_extern_crate_alloc
299.wyz v0.2.00.5s0.0s (3%)alloc
300.untrusted v0.7.10.5s0.1s (11%)
301.openssl-sys v0.9.59 custom-build (run)0.5s0.0s (0%)
302.adler v0.2.30.5s0.1s (30%)
303.want v0.3.00.5s0.2s (32%)
304.nom v5.1.2 custom-build0.5s0.0s (0%)alloc, default, lexical, lexical-core, std
305.memoffset v0.6.1 custom-build0.5s0.0s (0%)default
306.actix-threadpool v0.3.30.5s0.2s (33%)
307.nom v6.0.1 custom-build0.5s0.0s (0%)alloc, bitvec
308.cookie v0.14.3 custom-build0.5s0.0s (0%)percent-encode, percent-encoding
309.indexmap v1.6.1 custom-build0.5s0.0s (0%)
310.num-iter v0.1.420.4s0.0s (3%)default, std
311.tokio v0.3.6 custom-build0.4s0.0s (0%)default, sync
312.thiserror v1.0.220.4s0.1s (28%)
313.num-rational v0.3.2 custom-build0.4s0.0s (0%)
314.tokio v0.3.6 custom-build (run)0.4s0.0s (0%)default, sync
315.tokio-tls v0.3.10.4s0.0s (9%)
316.adler32 v1.2.00.4s0.1s (33%)default, std
317.bytemuck v1.4.10.4s0.0s (9%)
318.memoffset v0.6.1 custom-build (run)0.4s0.0s (0%)default
319.standback v0.2.13 custom-build (run)0.4s0.0s (0%)std
320.num-iter v0.1.42 custom-build0.4s0.0s (0%)default, std
321.buf-min v0.2.00.4s0.0s (5%)bytes, bytes-buf
322.itoa v0.4.60.4s0.0s (5%)default, std
323.nom v4.2.3 custom-build0.4s0.0s (0%)alloc, default, std
324.derive_builder v0.9.0 custom-build0.4s0.0s (0%)
325.lexical-core v0.7.4 custom-build0.4s0.0s (0%)arrayvec, correct, default, ryu, static_assertions, std, table
326.rayon-core v1.9.0 custom-build0.4s0.0s (0%)
327.v_escape v0.14.1 custom-build0.4s0.0s (0%)bytes-buf
328.ident_case v1.0.10.4s0.1s (17%)
329.unchecked-index v0.2.20.4s0.0s (9%)
330.static_assertions v1.1.00.4s0.0s (4%)
331.http-body v0.3.10.4s0.0s (10%)
332.typed-arena v1.7.00.4s0.0s (4%)default, std
333.anyhow v1.0.35 custom-build (run)0.4s0.0s (0%)default, std
334.tracing-futures v0.2.40.4s0.0s (6%)pin-project, std-future
335.fxhash v0.2.10.4s0.1s (19%)
336.async-mutex v1.4.00.3s0.0s (7%)
337.unicode-xid v0.2.10.3s0.1s (19%)default
338.lru-cache v0.1.20.3s0.0s (3%)
339.digest v0.9.00.3s0.0s (7%)alloc, std
340.scopeguard v1.1.00.3s0.0s (9%)
341.lazy_static v1.4.00.3s0.0s (12%)
342.background-jobs v0.8.00.3s0.0s (4%)background-jobs-actix, default
343.futures v0.3.80.3s0.0s (7%)alloc, async-await, default, executor, futures-executor, std
344.strum v0.20.00.3s0.0s (10%)
345.block-buffer v0.9.00.3s0.0s (14%)
346.atty v0.2.140.3s0.0s (8%)
347.proc-macro-nested v0.1.60.3s0.0s (6%)
348.hyper-tls v0.4.30.3s0.0s (9%)
349.webpki-roots v0.20.00.3s0.0s (7%)
350.memoffset v0.6.10.3s0.0s (5%)default
351.darling v0.10.20.3s0.0s (6%)default, suggestions
352.tap v1.0.00.3s0.0s (6%)
353.cpuid-bool v0.1.20.3s0.0s (12%)
354.fnv v1.0.70.3s0.0s (5%)default, std
355.instant v0.1.90.3s0.0s (17%)
356.futures-sink v0.3.80.3s0.0s (5%)alloc, default, std
357.cookie v0.14.3 custom-build (run)0.3s0.0s (0%)percent-encode, percent-encoding
358.quick-error v1.2.30.3s0.0s (7%)
359.try-lock v0.2.30.3s0.0s (7%)
360.bitflags v1.2.10.3s0.0s (8%)default
361.tower-service v0.3.00.3s0.0s (4%)
362.pin-project v0.4.270.3s0.0s (5%)
363.match_cfg v0.1.00.2s0.0s (14%)default, use_core
364.copyless v0.1.50.2s0.0s (5%)
365.cfg-if v0.1.100.2s0.0s (8%)
366.num-traits v0.1.430.2s0.0s (4%)
367.pin-utils v0.1.00.2s0.0s (4%)
368.maybe-uninit v2.0.00.2s0.0s (6%)
369.nom v6.0.1 custom-build (run)0.2s0.0s (0%)alloc, bitvec
370.brotli-sys v0.3.20.2s0.0s (7%)
371.crc32fast v1.2.1 custom-build (run)0.2s0.0s (0%)default, std
372.standback v0.2.130.2s0.0s (8%)std
373.nom v4.2.3 custom-build (run)0.2s0.0s (0%)alloc, default, std
374.maplit v1.0.20.2s0.0s (5%)
375.foreign-types v0.3.20.2s0.0s (7%)
376.cfg-if v1.0.00.2s0.0s (8%)
377.serde_derive v1.0.118 custom-build (run)0.2s0.0s (0%)default
378.opaque-debug v0.3.00.2s0.0s (9%)
379.nom v5.1.2 custom-build (run)0.2s0.0s (0%)alloc, default, lexical, lexical-core, std
380.proc-macro2 v1.0.24 custom-build (run)0.2s0.0s (0%)default, proc-macro
381.tinyvec_macros v0.1.00.2s0.0s (7%)
382.foreign-types-shared v0.1.10.2s0.0s (9%)
383.pin-project-lite v0.1.110.2s0.0s (4%)
384.generic-array v0.14.4 custom-build (run)0.2s0.0s (0%)
385.serde v1.0.118 custom-build (run)0.2s0.0s (0%)default, derive, serde_derive, std
386.pin-project v1.0.20.2s0.0s (5%)
387.serde_json v1.0.60 custom-build (run)0.2s0.0s (0%)default, indexmap, preserve_order, std
388.time v0.2.23 custom-build (run)0.2s0.0s (0%)libc, std, stdweb, winapi
389.pin-project-internal v0.4.27 custom-build (run)0.2s0.0s (0%)
390.syn v1.0.54 custom-build (run)0.2s0.0s (0%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
391.v_escape v0.14.10.2s0.0s (5%)bytes-buf
392.const_fn v0.4.4 custom-build (run)0.2s0.0s (0%)
393.bitflags v1.2.1 custom-build (run)0.2s0.0s (0%)default
394.time-macros v0.1.10.2s0.0s (6%)
395.diesel_migrations v1.4.00.2s0.0s (4%)default
396.ryu v1.0.5 custom-build (run)0.2s0.0s (0%)
397.proc-macro-hack v0.5.19 custom-build (run)0.2s0.0s (0%)
398.byteorder v1.3.4 custom-build (run)0.2s0.0s (0%)default, std
399.pin-project-lite v0.2.00.2s0.0s (4%)
400.pq-sys v0.4.6 custom-build (run)0.2s0.0s (0%)
401.httparse v1.3.4 custom-build (run)0.2s0.0s (0%)default, std
402.libc v0.2.81 custom-build (run)0.2s0.0s (0%)align, default, std
403.maybe-uninit v2.0.0 custom-build (run)0.2s0.0s (0%)
404.hyperx v1.2.0 custom-build (run)0.1s0.0s (0%)headers
405.typenum v1.12.0 custom-build (run)0.1s0.0s (0%)
406.mime_guess v2.0.3 custom-build (run)0.1s0.0s (0%)default, rev-mappings
407.proc-macro-nested v0.1.6 custom-build (run)0.0s0.0s (0%)
408.encoding_rs v0.8.26 custom-build (run)0.0s0.0s (0%)
409.num-integer v0.1.44 custom-build (run)0.0s0.0s (0%)i128, std
410.radium v0.5.3 custom-build (run)0.0s0.0s (0%)
411.native-tls v0.2.6 custom-build (run)0.0s0.0s (0%)
412.v_htmlescape v0.11.0 custom-build (run)0.0s0.0s (0%)bytes-buf, default
413.memchr v2.3.4 custom-build (run)0.0s0.0s (1%)default, std, use_std
414.openssl v0.10.31 custom-build (run)0.0s0.0s (0%)
415.getrandom v0.1.15 custom-build (run)0.0s0.0s (0%)std
416.lexical-core v0.7.4 custom-build (run)0.0s0.0s (1%)arrayvec, correct, default, ryu, static_assertions, std, table
417.derive_builder v0.9.0 custom-build (run)0.0s0.0s (0%)
418.v_escape v0.14.1 custom-build (run)0.0s0.0s (0%)bytes-buf
419.log v0.4.11 custom-build (run)0.0s0.0s (1%)std
420.rayon-core v1.9.0 custom-build (run)0.0s0.0s (0%)
421.getrandom v0.2.0 custom-build (run)0.0s0.0s (1%)std
- - - diff --git a/cargo-timing.html b/cargo-timing.html deleted file mode 100644 index 6fee64e39..000000000 --- a/cargo-timing.html +++ /dev/null @@ -1,23388 +0,0 @@ - - - - Cargo Build Timings — lemmy_server 0.0.1 - - - - - -

Cargo Build Timings

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Targets:lemmy_server 0.0.1 (lib, bin "lemmy_server")
Profile:dev
Fresh units:0
Dirty units:421
Total units:421
Max concurrency:12 (jobs=12 ncpu=12)
Build start:2020-12-21T13:35:31Z
Total time:168.7s (2m 48.7s)
rustc:rustc 1.50.0-nightly (825637983 2020-11-18)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency:0
- - - - - - - - - - - - - - -
- -
- - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
UnitTotalCodegenFeatures
1.lemmy_db v0.1.038.6s5.5s (14%)
2.diesel v1.4.522.2s0.4s (2%)32-column-tables, bitflags, chrono, default, postgres, pq-sys, r2d2, serde_json, with-deprecated
3.rustls v0.18.116.6s11.6s (70%)dangerous_configuration, default, log, logging
4.serde_derive v1.0.11816.2s0.0s (0%)default
5.derive_more v0.99.1115.6s0.0s (0%)add, add_assign, as_mut, as_ref, constructor, default, deref, deref_mut, display, error, from, from_str, index, index_mut, into, into_iterator, iterator, mul, mul_assign, not, sum, try_into
6.syn v1.0.5415.2s3.4s (23%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
7.lemmy_server v0.0.114.3s8.9s (62%)
8.diesel_derives v1.4.112.9s0.0s (0%)default, postgres
9.tokio v0.2.2412.5s6.0s (48%)blocking, default, fnv, futures-core, io-driver, io-util, iovec, lazy_static, libc, memchr, mio, mio-uds, rt-core, rt-util, signal, signal-hook-registry, slab, stream, sync, tcp, time, udp, uds, winapi
10.brotli-sys v0.3.2 custom-build (run)11.8s0.0s (0%)
11.h2 v0.2.711.4s4.4s (38%)
12.regex v1.4.211.1s8.2s (74%)aho-corasick, default, memchr, perf, perf-cache, perf-dfa, perf-inline, perf-literal, std, thread_local, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment
13.hyper v0.13.910.6s1.1s (10%)socket2, tcp
14.image v0.23.1210.5s4.2s (39%)bmp, dds, default, dxt, farbfeld, gif, hdr, ico, jpeg, jpeg_rayon, png, pnm, scoped_threadpool, tga, tiff, webp
15.regex-syntax v0.6.2110.5s5.0s (47%)default, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment
16.object v0.22.010.4s4.5s (43%)archive, coff, elf, macho, pe, read_core, unaligned
17.lemmy_apub v0.1.010.2s4.4s (43%)
18.lemmy_api v0.1.010.0s4.5s (45%)
19.lemmy_db_schema v0.1.010.0s1.2s (12%)
20.darling_core v0.10.29.8s6.0s (61%)strsim, suggestions
21.futures-util v0.3.89.7s0.2s (2%)alloc, async-await, async-await-macro, channel, default, futures-channel, futures-io, futures-macro, futures-sink, io, memchr, proc-macro-hack, proc-macro-nested, sink, slab, std
22.encoding_rs v0.8.269.1s4.2s (46%)
23.comrak v0.9.09.1s4.4s (49%)
24.strum_macros v0.20.18.8s0.0s (0%)
25.openssl v0.10.318.4s2.8s (33%)
26.pest_meta v2.1.38.1s5.2s (65%)
27.actix-http v2.2.07.8s3.1s (39%)actix-tls, brotli2, compress, default, flate2, rustls
28.actix-web v3.3.27.5s1.2s (15%)compress, default, rust-tls, rustls
29.activitystreams v0.7.0-alpha.87.4s1.2s (17%)
30.http v0.2.27.3s2.1s (28%)
31.gimli v0.23.07.3s1.2s (17%)read
32.serde_json v1.0.607.0s4.6s (65%)default, indexmap, preserve_order, std
33.pin-project-internal v0.4.277.0s0.0s (0%)
34.jpeg-decoder v0.1.206.7s5.2s (78%)rayon
35.reqwest v0.10.106.6s4.4s (66%)__tls, default, default-tls, hyper-tls, json, native-tls-crate, serde_json, tokio-tls
36.hyperx v1.2.06.5s3.4s (51%)headers
37.time v0.2.236.4s2.0s (31%)libc, std, stdweb, winapi
38.ring v0.16.196.2s3.0s (49%)alloc, default, dev_urandom_fallback, once_cell, std
39.chrono v0.4.196.0s3.5s (59%)clock, default, libc, oldtime, serde, std, time, winapi
40.lemmy_server v0.0.1 bin "lemmy_server"5.9s0.0s (0%)
41.serde v1.0.1185.8s0.5s (8%)default, derive, serde_derive, std
42.aho-corasick v0.7.155.8s3.0s (52%)default, std
43.pin-project-internal v1.0.25.8s0.0s (0%)
44.tiff v0.6.15.8s0.9s (15%)
45.ring v0.16.19 custom-build (run)5.6s0.0s (0%)alloc, default, dev_urandom_fallback, once_cell, std
46.nom v5.1.25.6s0.6s (11%)alloc, default, lexical, lexical-core, std
47.trust-dns-proto v0.19.65.6s1.8s (33%)tokio, tokio-runtime
48.nom v6.0.15.4s0.5s (10%)alloc, bitvec
49.darling_macro v0.10.25.2s0.0s (0%)
50.awc v2.0.35.0s2.2s (43%)compress, rust-tls, rustls
51.lodepng v3.2.25.0s3.1s (62%)default, rust_backend
52.rayon v1.5.04.9s0.5s (10%)
53.backtrace v0.3.554.9s3.8s (78%)addr2line, default, gimli-symbolize, miniz_oxide, object, std
54.config v0.10.14.8s3.5s (73%)hjson, serde-hjson
55.bitvec v0.19.44.8s0.1s (1%)alloc
56.async-trait v0.1.424.8s0.0s (0%)
57.serde v0.8.234.8s0.3s (7%)default, std
58.cc v1.0.664.5s3.1s (69%)
59.lettre v0.10.0-alpha.44.5s1.2s (26%)base64, builder, default, file-transport, hostname, hyperx, mime, native-tls, nom, quoted_printable, r2d2, rand, sendmail-transport, serde, serde_json, smtp-transport
60.serde-hjson v0.9.14.5s2.7s (60%)default, linked-hash-map, preserve_order
61.lemmy_structs v0.1.04.4s0.4s (8%)
62.proc-macro-hack v0.5.194.4s0.0s (0%)
63.lexical-core v0.7.44.2s0.4s (8%)arrayvec, correct, default, ryu, static_assertions, std, table
64.trust-dns-resolver v0.19.64.1s2.0s (49%)ipconfig, resolv-conf, system-config, tokio, tokio-runtime
65.thiserror-impl v1.0.224.1s0.0s (0%)
66.proc-macro2 v1.0.244.0s2.2s (54%)default, proc-macro
67.num-bigint v0.2.64.0s1.5s (37%)default, std
68.rand v0.7.33.8s0.9s (23%)alloc, default, getrandom, getrandom_package, libc, std
69.pest v2.1.33.7s1.0s (27%)
70.tokio v0.3.63.6s1.1s (32%)default, sync
71.miniz_oxide v0.3.73.3s1.9s (57%)
72.nom v4.2.33.2s0.7s (23%)alloc, default, std
73.itertools v0.9.03.2s0.9s (28%)default, use_std
74.mio v0.6.233.1s1.3s (42%)default, with-deprecated
75.actix-web-codegen v0.4.03.1s0.0s (0%)
76.rayon-core v1.9.02.9s1.6s (56%)
77.unicode-normalization v0.1.162.9s0.6s (21%)default, std
78.v_escape_derive v0.8.42.8s0.0s (0%)
79.lemmy_utils v0.1.02.7s0.6s (24%)
80.futures-macro v0.3.82.6s0.0s (0%)
81.tinyvec v1.1.02.6s0.1s (3%)alloc, default, tinyvec_macros
82.num-traits v0.2.142.6s0.1s (6%)default, i128, std
83.miniz_oxide v0.4.32.6s1.0s (40%)no_extern_crate_alloc
84.actix v0.10.02.6s0.3s (13%)default, resolver, trust-dns-proto, trust-dns-resolver
85.num-rational v0.3.22.6s1.5s (57%)
86.typenum v1.12.02.6s0.1s (4%)
87.deflate v0.8.62.5s1.3s (52%)
88.const_fn v0.4.42.5s0.0s (0%)
89.png v0.16.82.5s1.0s (39%)default, deflate, png-encoding
90.gif v0.11.12.4s1.4s (57%)default, raii_no_panic, std
91.background-jobs-core v0.8.02.4s0.4s (15%)actix-rt, default, tokio, with-actix
92.pest_generator v2.1.32.4s1.1s (47%)
93.funty v1.0.12.3s1.1s (47%)
94.idna v0.2.02.3s0.9s (40%)
95.rand_chacha v0.2.22.3s1.7s (74%)std
96.ipnet v2.3.02.3s1.3s (57%)
97.num_cpus v1.13.02.3s1.4s (62%)
98.time v0.1.442.3s1.0s (44%)
99.webpki v0.21.42.2s0.7s (30%)default, std, trust_anchor_util
100.url v2.2.02.2s0.5s (22%)serde
101.mime_guess v2.0.3 custom-build2.2s0.0s (0%)default, rev-mappings
102.libc v0.2.812.2s0.2s (11%)align, default, std
103.actix-server v1.0.42.1s1.3s (59%)default
104.language-tags v0.2.22.1s1.6s (73%)
105.signal-hook-registry v1.2.22.1s1.3s (62%)
106.time-macros-impl v0.1.12.1s0.0s (0%)
107.actix_derive v0.5.02.1s0.0s (0%)
108.captcha v0.0.82.1s1.3s (61%)
109.unicode-bidi v0.3.42.0s1.3s (61%)default
110.crossbeam-utils v0.7.2 custom-build (run)2.0s0.0s (0%)default, lazy_static, std
111.crossbeam-utils v0.8.1 custom-build (run)2.0s0.0s (0%)default, lazy_static, std
112.http-signature-normalization v0.5.32.0s1.3s (64%)
113.pkg-config v0.3.192.0s1.3s (68%)
114.actix-router v0.2.52.0s0.5s (25%)default, http
115.env_logger v0.8.21.9s1.0s (54%)atty, default, humantime, regex, termcolor
116.lemmy_websocket v0.1.01.9s0.6s (32%)
117.tracing-core v0.1.171.9s0.9s (48%)lazy_static, std
118.crossbeam-channel v0.5.01.9s0.7s (34%)crossbeam-utils, default, std
119.net2 v0.2.371.9s1.1s (56%)default, duration
120.rss v1.9.01.9s0.4s (21%)builders, default, derive_builder
121.crossbeam-channel v0.4.41.9s0.6s (31%)
122.bytes v0.6.01.8s0.7s (36%)default, std
123.bytes v0.5.61.8s0.7s (36%)default, std
124.typenum v1.12.0 custom-build1.8s0.0s (0%)
125.ring v0.16.19 custom-build1.8s0.0s (0%)alloc, default, dev_urandom_fallback, once_cell, std
126.anyhow v1.0.351.8s0.9s (50%)default, std
127.derive_builder_core v0.9.01.8s0.9s (51%)
128.scoped_threadpool v0.1.91.8s1.4s (76%)
129.mime_guess v2.0.31.7s0.5s (30%)default, rev-mappings
130.memchr v2.3.41.7s0.8s (45%)default, std, use_std
131.quote v1.0.71.7s0.9s (51%)default, proc-macro
132.socket2 v0.3.181.7s0.8s (49%)
133.v_htmlescape v0.11.01.7s0.5s (28%)bytes-buf, default
134.native-tls v0.2.61.7s0.4s (21%)
135.resolv-conf v0.7.01.7s0.8s (49%)hostname, system
136.quick-xml v0.17.21.7s0.7s (44%)default, encoding, encoding_rs
137.weezl v0.1.31.6s0.9s (54%)alloc, default, std
138.enum-as-inner v0.3.31.6s0.0s (0%)
139.autocfg v1.0.11.6s1.0s (63%)
140.brotli2 v0.3.21.6s0.3s (21%)
141.parking_lot_core v0.8.11.6s0.7s (44%)
142.openssl-sys v0.9.591.6s0.2s (14%)
143.flate2 v1.0.191.6s0.5s (29%)default, miniz_oxide, rust_backend
144.bcrypt v0.9.01.6s0.4s (26%)default, std
145.crossbeam-utils v0.8.11.6s0.6s (42%)default, lazy_static, std
146.indexmap v1.6.11.5s0.3s (16%)
147.derive_builder v0.9.01.5s0.0s (0%)
148.xdg v2.2.01.5s1.0s (65%)
149.actix-files v0.4.11.5s0.4s (29%)
150.jsonwebtoken v7.2.01.5s0.4s (29%)
151.rustc-demangle v0.1.181.5s0.8s (52%)
152.sha2 v0.9.21.5s0.8s (54%)default, std
153.parking_lot v0.11.11.4s0.8s (56%)default
154.openssl-sys v0.9.59 custom-build1.4s0.0s (0%)
155.unicode-segmentation v1.7.11.4s0.3s (24%)
156.tracing v0.1.221.4s0.5s (37%)log, std
157.twoway v0.2.11.4s0.7s (47%)default, use_std
158.sct v0.6.01.4s1.0s (69%)
159.crossbeam-utils v0.7.21.4s0.6s (45%)default, lazy_static, std
160.termcolor v1.1.21.3s0.7s (50%)
161.version_check v0.9.21.3s0.8s (61%)
162.actix-rt v1.1.11.3s0.7s (51%)
163.num-integer v0.1.441.3s0.4s (32%)i128, std
164.addr2line v0.14.01.3s0.5s (40%)
165.threadpool v1.8.11.3s0.8s (65%)
166.httparse v1.3.41.3s0.5s (41%)default, std
167.serde_test v0.8.231.3s0.2s (17%)
168.http-signature-normalization-actix v0.4.11.3s0.3s (21%)base64, digest, sha-2, sha2
169.hashbrown v0.9.11.3s0.1s (5%)raw
170.crossbeam-epoch v0.9.11.3s0.6s (46%)alloc, lazy_static, std
171.pest_derive v2.1.01.3s0.0s (0%)
172.cookie v0.14.31.2s0.5s (39%)percent-encode, percent-encoding
173.actix-service v1.0.61.2s0.0s (2%)
174.httparse v1.3.4 custom-build1.2s0.0s (0%)default, std
175.version_check v0.1.51.2s0.8s (68%)
176.tokio-util v0.3.11.2s0.4s (29%)codec, compat, default, full, futures-io, udp
177.log v0.4.111.2s0.6s (46%)std
178.simple_asn1 v0.4.11.2s0.5s (42%)
179.hyperx v1.2.0 custom-build1.2s0.0s (0%)headers
180.arrayvec v0.5.21.2s0.0s (3%)array-sizes-33-128, default, std
181.actix-macros v0.1.31.2s0.0s (0%)
182.unicase v2.6.0 custom-build (run)1.2s0.0s (0%)
183.byteorder v1.3.4 custom-build1.1s0.0s (0%)default, std
184.ucd-trie v0.1.31.1s0.7s (64%)default, std
185.base64 v0.13.01.1s0.3s (30%)default, std
186.uuid v0.8.11.1s0.2s (15%)default, rand, serde, std, v4
187.strsim v0.9.31.1s0.7s (59%)
188.rgb v0.8.251.1s0.0s (3%)as-bytes, bytemuck, default
189.pq-sys v0.4.6 custom-build1.1s0.0s (0%)
190.crc32fast v1.2.11.1s0.4s (38%)default, std
191.byteorder v1.3.41.1s0.2s (22%)default, std
192.mime v0.3.161.1s0.5s (45%)
193.base64 v0.12.31.1s0.4s (33%)default, std
194.ppv-lite86 v0.2.101.1s0.0s (4%)simd, std
195.ryu v1.0.51.1s0.5s (47%)
196.miniz_oxide v0.4.3 custom-build (run)1.1s0.0s (0%)no_extern_crate_alloc
197.actix-connect v2.0.01.1s0.2s (22%)default, http, rust-tls, rustls, tokio-rustls, uri, webpki
198.unicase v2.6.01.0s0.4s (43%)
199.pem v0.8.21.0s0.6s (55%)
200.proc-macro2 v1.0.24 custom-build1.0s0.0s (0%)default, proc-macro
201.want v0.3.01.0s0.5s (53%)
202.lemmy_rate_limit v0.1.01.0s0.2s (16%)
203.generic-array v0.14.41.0s0.0s (3%)
204.const_fn v0.4.4 custom-build1.0s0.0s (0%)
205.scheduled-thread-pool v0.2.51.0s0.6s (59%)
206.humantime v2.0.11.0s0.4s (42%)
207.num-iter v0.1.42 custom-build (run)1.0s0.0s (0%)default, std
208.num-bigint v0.2.6 custom-build (run)1.0s0.0s (0%)default, std
209.standback v0.2.13 custom-build (run)0.9s0.0s (0%)std
210.num-rational v0.3.2 custom-build (run)0.9s0.0s (0%)
211.getrandom v0.1.150.9s0.4s (38%)std
212.actix-utils v2.0.00.9s0.2s (25%)
213.hound v3.4.00.9s0.2s (21%)
214.serde_urlencoded v0.7.00.9s0.2s (17%)
215.maybe-uninit v2.0.0 custom-build0.9s0.0s (0%)
216.pq-sys v0.4.60.9s0.3s (36%)
217.actix-web-actors v3.0.00.9s0.1s (13%)
218.num-traits v0.2.14 custom-build (run)0.9s0.0s (0%)default, i128, std
219.libc v0.2.81 custom-build0.9s0.0s (0%)align, default, std
220.color_quant v1.1.00.9s0.5s (53%)
221.pin-project-internal v0.4.27 custom-build0.9s0.0s (0%)
222.serde_json v1.0.60 custom-build0.9s0.0s (0%)default, indexmap, preserve_order, std
223.hostname v0.3.10.9s0.4s (50%)default
224.serde v1.0.118 custom-build0.9s0.0s (0%)default, derive, serde_derive, std
225.syn v1.0.54 custom-build0.9s0.0s (0%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
226.ryu v1.0.5 custom-build0.8s0.0s (0%)
227.sha-1 v0.9.20.8s0.4s (47%)default, std
228.crc32fast v1.2.1 custom-build0.8s0.0s (0%)default, std
229.anyhow v1.0.35 custom-build0.8s0.0s (0%)default, std
230.rayon v1.5.0 custom-build (run)0.8s0.0s (0%)
231.heck v0.3.10.8s0.4s (48%)
232.iovec v0.1.40.8s0.3s (37%)
233.getrandom v0.2.00.8s0.3s (35%)std
234.background-jobs-actix v0.8.00.8s0.2s (22%)
235.quoted_printable v0.4.20.8s0.4s (54%)
236.indexmap v1.6.1 custom-build (run)0.8s0.0s (0%)
237.proc-macro-hack v0.5.19 custom-build0.8s0.0s (0%)
238.event-listener v2.5.10.8s0.4s (50%)
239.httpdate v0.3.20.8s0.4s (48%)
240.percent-encoding v2.1.00.8s0.4s (49%)
241.thread_local v1.0.10.8s0.3s (41%)
242.serde_derive v1.0.118 custom-build0.8s0.0s (0%)default
243.bitflags v1.2.1 custom-build0.8s0.0s (0%)default
244.activitystreams-ext v0.1.0-alpha.20.7s0.0s (2%)
245.futures-channel v0.3.80.7s0.1s (9%)alloc, default, futures-sink, sink, std
246.migrations_macros v1.4.20.7s0.0s (0%)default
247.rand_core v0.5.10.7s0.2s (30%)alloc, getrandom, std
248.entities v1.0.10.7s0.1s (20%)
249.proc-macro-nested v0.1.6 custom-build0.7s0.0s (0%)
250.radium v0.5.30.7s0.1s (8%)
251.time v0.2.23 custom-build (run)0.7s0.0s (0%)libc, std, stdweb, winapi
252.memchr v2.3.4 custom-build0.7s0.0s (0%)default, std, use_std
253.openssl-sys v0.9.59 custom-build (run)0.7s0.0s (0%)
254.nom v6.0.1 custom-build (run)0.7s0.0s (0%)alloc, bitvec
255.radium v0.5.3 custom-build0.7s0.0s (0%)
256.linked-hash-map v0.3.00.7s0.0s (5%)serde, serde_impl, serde_test
257.futures-io v0.3.80.7s0.3s (44%)default, std
258.smallvec v1.5.10.7s0.1s (9%)
259.unicode_categories v0.1.10.6s0.1s (14%)
260.r2d2 v0.8.90.6s0.1s (13%)
261.getrandom v0.2.0 custom-build0.6s0.0s (0%)std
262.http-body v0.3.10.6s0.1s (15%)
263.getrandom v0.1.15 custom-build0.6s0.0s (0%)std
264.bytestring v0.1.50.6s0.2s (36%)
265.mio-uds v0.6.80.6s0.2s (33%)
266.once_cell v1.5.20.6s0.2s (34%)alloc, default, std
267.time v0.2.23 custom-build0.6s0.0s (0%)libc, std, stdweb, winapi
268.openssl-probe v0.1.20.6s0.3s (54%)
269.lock_api v0.4.20.6s0.0s (8%)
270.brotli-sys v0.3.2 custom-build0.6s0.0s (0%)
271.num-bigint v0.2.6 custom-build0.6s0.0s (0%)default, std
272.shell-words v1.0.00.6s0.3s (46%)
273.openssl v0.10.31 custom-build0.6s0.0s (0%)
274.tokio-rustls v0.14.10.6s0.1s (13%)
275.rayon v1.5.0 custom-build0.6s0.0s (0%)
276.form_urlencoded v1.0.00.6s0.2s (33%)
277.crossbeam-utils v0.7.2 custom-build0.6s0.0s (0%)default, lazy_static, std
278.futures-task v0.3.80.6s0.2s (33%)alloc, once_cell, std
279.standback v0.2.13 custom-build0.6s0.0s (0%)std
280.futures-executor v0.3.80.6s0.2s (30%)std
281.log v0.4.11 custom-build0.5s0.0s (0%)std
282.actix-codec v0.3.00.5s0.1s (9%)
283.memoffset v0.6.1 custom-build (run)0.5s0.0s (0%)default
284.nom v6.0.1 custom-build0.5s0.0s (0%)alloc, bitvec
285.crossbeam-deque v0.8.00.5s0.0s (4%)crossbeam-epoch, crossbeam-utils, default, std
286.adler v0.2.30.5s0.2s (39%)
287.native-tls v0.2.6 custom-build0.5s0.0s (0%)
288.num-rational v0.3.2 custom-build0.5s0.0s (0%)
289.futures-core v0.3.80.5s0.2s (38%)alloc, default, std
290.num-integer v0.1.44 custom-build0.5s0.0s (0%)i128, std
291.tokio v0.3.6 custom-build (run)0.5s0.0s (0%)default, sync
292.num-traits v0.2.14 custom-build0.5s0.0s (0%)default, i128, std
293.crossbeam-utils v0.8.1 custom-build0.5s0.0s (0%)default, lazy_static, std
294.migrations_internals v1.4.10.5s0.1s (20%)default
295.cipher v0.2.50.5s0.0s (8%)
296.adler32 v1.2.00.5s0.2s (32%)default, std
297.linked-hash-map v0.5.30.5s0.0s (3%)
298.v_htmlescape v0.11.0 custom-build0.5s0.0s (0%)bytes-buf, default
299.v_escape v0.14.1 custom-build0.5s0.0s (0%)bytes-buf
300.miniz_oxide v0.4.3 custom-build0.5s0.0s (0%)no_extern_crate_alloc
301.memoffset v0.6.1 custom-build0.5s0.0s (0%)default
302.num-iter v0.1.42 custom-build0.5s0.0s (0%)default, std
303.unicase v2.6.0 custom-build0.5s0.0s (0%)
304.tokio v0.3.6 custom-build0.5s0.0s (0%)default, sync
305.blowfish v0.7.00.5s0.1s (22%)bcrypt
306.either v1.6.10.5s0.0s (7%)default, use_std
307.encoding_rs v0.8.26 custom-build0.5s0.0s (0%)
308.nom v4.2.3 custom-build0.5s0.0s (0%)alloc, default, std
309.generic-array v0.14.4 custom-build0.4s0.0s (0%)
310.lru-cache v0.1.20.4s0.0s (3%)
311.indexmap v1.6.1 custom-build0.4s0.0s (0%)
312.cookie v0.14.3 custom-build0.4s0.0s (0%)percent-encode, percent-encoding
313.untrusted v0.7.10.4s0.1s (27%)
314.tokio-tls v0.3.10.4s0.1s (12%)
315.buf-min v0.2.00.4s0.0s (11%)bytes, bytes-buf
316.bytemuck v1.4.10.4s0.0s (8%)
317.wyz v0.2.00.4s0.0s (9%)alloc
318.actix-threadpool v0.3.30.4s0.1s (19%)
319.itoa v0.4.60.4s0.0s (5%)default, std
320.nom v5.1.2 custom-build0.4s0.0s (0%)alloc, default, lexical, lexical-core, std
321.ident_case v1.0.10.4s0.1s (24%)
322.derive_builder v0.9.0 custom-build0.4s0.0s (0%)
323.proc-macro-nested v0.1.60.4s0.0s (6%)
324.anyhow v1.0.35 custom-build (run)0.4s0.0s (0%)default, std
325.http-signature-normalization-reqwest v0.1.30.4s0.1s (19%)base64, digest, sha-2, sha2, tokio
326.spin v0.5.20.4s0.0s (11%)
327.atty v0.2.140.4s0.1s (14%)
328.brotli-sys v0.3.20.4s0.0s (10%)
329.rayon-core v1.9.0 custom-build0.4s0.0s (0%)
330.slab v0.4.20.4s0.0s (7%)
331.lexical-core v0.7.4 custom-build0.4s0.0s (0%)arrayvec, correct, default, ryu, static_assertions, std, table
332.bitflags v1.2.10.4s0.0s (12%)default
333.unicode-xid v0.2.10.4s0.1s (15%)default
334.thiserror v1.0.220.4s0.0s (11%)
335.generic-array v0.14.4 custom-build (run)0.4s0.0s (0%)
336.fxhash v0.2.10.3s0.1s (20%)
337.hyper-tls v0.4.30.3s0.0s (11%)
338.actix-tls v2.0.00.3s0.1s (17%)default, rust-tls, rustls, tokio-rustls, webpki, webpki-roots
339.digest v0.9.00.3s0.0s (8%)alloc, std
340.async-mutex v1.4.00.3s0.0s (5%)
341.block-buffer v0.9.00.3s0.0s (5%)
342.typed-arena v1.7.00.3s0.0s (6%)default, std
343.strum v0.20.00.3s0.0s (12%)
344.tap v1.0.00.3s0.0s (11%)
345.unchecked-index v0.2.20.3s0.0s (9%)
346.num-iter v0.1.420.3s0.0s (6%)default, std
347.webpki-roots v0.20.00.3s0.0s (11%)
348.standback v0.2.130.3s0.1s (18%)std
349.copyless v0.1.50.3s0.0s (6%)
350.futures-sink v0.3.80.3s0.0s (11%)alloc, default, std
351.quick-error v1.2.30.3s0.0s (11%)
352.maplit v1.0.20.3s0.0s (15%)
353.tracing-futures v0.2.40.3s0.0s (5%)pin-project, std-future
354.v_escape v0.14.10.3s0.0s (14%)bytes-buf
355.cookie v0.14.3 custom-build (run)0.3s0.0s (0%)percent-encode, percent-encoding
356.fnv v1.0.70.3s0.0s (15%)default, std
357.actix-testing v1.0.10.3s0.0s (16%)
358.scopeguard v1.1.00.3s0.0s (9%)
359.lazy_static v1.4.00.3s0.0s (13%)
360.cpuid-bool v0.1.20.3s0.0s (15%)
361.futures v0.3.80.2s0.0s (4%)alloc, async-await, default, executor, futures-executor, std
362.background-jobs v0.8.00.2s0.0s (4%)background-jobs-actix, default
363.pin-project v1.0.20.2s0.0s (6%)
364.memoffset v0.6.10.2s0.0s (15%)default
365.pin-project v0.4.270.2s0.0s (10%)
366.nom v4.2.3 custom-build (run)0.2s0.0s (0%)alloc, default, std
367.crc32fast v1.2.1 custom-build (run)0.2s0.0s (0%)default, std
368.nom v5.1.2 custom-build (run)0.2s0.0s (0%)alloc, default, lexical, lexical-core, std
369.match_cfg v0.1.00.2s0.0s (8%)default, use_core
370.pin-project-lite v0.1.110.2s0.0s (10%)
371.foreign-types-shared v0.1.10.2s0.0s (8%)
372.try-lock v0.2.30.2s0.0s (10%)
373.tinyvec_macros v0.1.00.2s0.0s (10%)
374.pin-project-lite v0.2.00.2s0.0s (5%)
375.proc-macro-hack v0.5.19 custom-build (run)0.2s0.0s (0%)
376.static_assertions v1.1.00.2s0.0s (5%)
377.darling v0.10.20.2s0.0s (9%)default, suggestions
378.maybe-uninit v2.0.00.2s0.0s (6%)
379.time-macros v0.1.10.2s0.0s (6%)
380.opaque-debug v0.3.00.2s0.0s (7%)
381.num-traits v0.1.430.2s0.0s (8%)
382.instant v0.1.90.2s0.0s (12%)
383.matches v0.1.80.2s0.0s (7%)
384.tower-service v0.3.00.2s0.0s (11%)
385.httparse v1.3.4 custom-build (run)0.2s0.0s (0%)default, std
386.cfg-if v1.0.00.2s0.0s (3%)
387.serde v1.0.118 custom-build (run)0.2s0.0s (0%)default, derive, serde_derive, std
388.pin-utils v0.1.00.2s0.0s (5%)
389.hyperx v1.2.0 custom-build (run)0.2s0.0s (0%)headers
390.serde_json v1.0.60 custom-build (run)0.2s0.0s (0%)default, indexmap, preserve_order, std
391.const_fn v0.4.4 custom-build (run)0.2s0.0s (0%)
392.serde_derive v1.0.118 custom-build (run)0.2s0.0s (0%)default
393.proc-macro2 v1.0.24 custom-build (run)0.2s0.0s (0%)default, proc-macro
394.ryu v1.0.5 custom-build (run)0.2s0.0s (0%)
395.foreign-types v0.3.20.2s0.0s (4%)
396.byteorder v1.3.4 custom-build (run)0.2s0.0s (0%)default, std
397.cfg-if v0.1.100.2s0.0s (4%)
398.maybe-uninit v2.0.0 custom-build (run)0.2s0.0s (0%)
399.bitflags v1.2.1 custom-build (run)0.2s0.0s (0%)default
400.libc v0.2.81 custom-build (run)0.2s0.0s (0%)align, default, std
401.pin-project-internal v0.4.27 custom-build (run)0.2s0.0s (0%)
402.syn v1.0.54 custom-build (run)0.2s0.0s (0%)clone-impls, default, derive, extra-traits, fold, full, parsing, printing, proc-macro, quote, visit, visit-mut
403.typenum v1.12.0 custom-build (run)0.2s0.0s (0%)
404.diesel_migrations v1.4.00.1s0.0s (5%)default
405.mime_guess v2.0.3 custom-build (run)0.1s0.0s (0%)default, rev-mappings
406.num-integer v0.1.44 custom-build (run)0.0s0.0s (1%)i128, std
407.proc-macro-nested v0.1.6 custom-build (run)0.0s0.0s (0%)
408.log v0.4.11 custom-build (run)0.0s0.0s (0%)std
409.getrandom v0.1.15 custom-build (run)0.0s0.0s (0%)std
410.memchr v2.3.4 custom-build (run)0.0s0.0s (0%)default, std, use_std
411.pq-sys v0.4.6 custom-build (run)0.0s0.0s (0%)
412.v_escape v0.14.1 custom-build (run)0.0s0.0s (0%)bytes-buf
413.getrandom v0.2.0 custom-build (run)0.0s0.0s (0%)std
414.radium v0.5.3 custom-build (run)0.0s0.0s (0%)
415.lexical-core v0.7.4 custom-build (run)0.0s0.0s (0%)arrayvec, correct, default, ryu, static_assertions, std, table
416.derive_builder v0.9.0 custom-build (run)0.0s0.0s (0%)
417.rayon-core v1.9.0 custom-build (run)0.0s0.0s (0%)
418.openssl v0.10.31 custom-build (run)0.0s0.0s (0%)
419.v_htmlescape v0.11.0 custom-build (run)0.0s0.0s (0%)bytes-buf, default
420.encoding_rs v0.8.26 custom-build (run)0.0s0.0s (0%)
421.native-tls v0.2.6 custom-build (run)0.0s0.0s (0%)
- - -