]> Untitled Git - lemmy.git/commitdiff
Remove dead code (#81)
authornutomic <nutomic@noreply.yerbamate.dev>
Wed, 12 Aug 2020 12:30:52 +0000 (12:30 +0000)
committerdessalines <dessalines@noreply.yerbamate.dev>
Wed, 12 Aug 2020 12:30:52 +0000 (12:30 +0000)
Add post_read back in, do some cleanup

Add some delete functions back in

Merge branch 'main' into remove-dead-code

Replace body of unused db functions with unimplemented!()

Remove dead code

Remove remaining usages of unwrap() from activitypub code

Remove most usage of Option::unwrap() from activitypub code

Co-authored-by: Felix Ableitner <me@nutomic.com>
Reviewed-on: https://yerbamate.dev/LemmyNet/lemmy/pulls/81

20 files changed:
server/lemmy_db/src/activity.rs
server/lemmy_db/src/category.rs
server/lemmy_db/src/comment.rs
server/lemmy_db/src/community.rs
server/lemmy_db/src/community_view.rs
server/lemmy_db/src/lib.rs
server/lemmy_db/src/moderator.rs
server/lemmy_db/src/password_reset_request.rs
server/lemmy_db/src/post.rs
server/lemmy_db/src/post_view.rs
server/lemmy_db/src/private_message.rs
server/lemmy_db/src/site.rs
server/lemmy_db/src/user_mention.rs
server/lemmy_db/src/user_view.rs
server/lemmy_utils/src/lib.rs
server/lemmy_utils/src/settings.rs
server/src/api/claims.rs
server/src/apub/fetcher.rs
server/src/main.rs
server/src/routes/mod.rs

index 3f7fd1d5c3d16a6ba321d01771599fce786ecb3c..a832334267f77b6efba1ffb2a91d498ddbf1c9e7 100644 (file)
@@ -34,11 +34,6 @@ impl Crud<ActivityForm> for Activity {
     activity.find(activity_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, activity_id: i32) -> Result<usize, Error> {
-    use crate::schema::activity::dsl::*;
-    diesel::delete(activity.find(activity_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, new_activity: &ActivityForm) -> Result<Self, Error> {
     use crate::schema::activity::dsl::*;
     insert_into(activity)
index ec2efc7b7a17aaa9f71fd921d4e305553fad103f..ff4e757bf77531e04c7706b9e40ac9283f6447f3 100644 (file)
@@ -23,10 +23,6 @@ impl Crud<CategoryForm> for Category {
     category.find(category_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, category_id: i32) -> Result<usize, Error> {
-    diesel::delete(category.find(category_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, new_category: &CategoryForm) -> Result<Self, Error> {
     insert_into(category)
       .values(new_category)
index 354922e85eb5433148155abc3fa0a3c1d1a7bc0c..6802ad62cdb6d39bb6e71eeb5747161e73276bc1 100644 (file)
@@ -172,13 +172,6 @@ pub struct CommentLikeForm {
 }
 
 impl Likeable<CommentLikeForm> for CommentLike {
-  fn read(conn: &PgConnection, comment_id_from: i32) -> Result<Vec<Self>, Error> {
-    use crate::schema::comment_like::dsl::*;
-    comment_like
-      .filter(comment_id.eq(comment_id_from))
-      .load::<Self>(conn)
-  }
-
   fn like(conn: &PgConnection, comment_like_form: &CommentLikeForm) -> Result<Self, Error> {
     use crate::schema::comment_like::dsl::*;
     insert_into(comment_like)
@@ -196,15 +189,6 @@ impl Likeable<CommentLikeForm> for CommentLike {
   }
 }
 
-impl CommentLike {
-  pub fn from_post(conn: &PgConnection, post_id_from: i32) -> Result<Vec<Self>, Error> {
-    use crate::schema::comment_like::dsl::*;
-    comment_like
-      .filter(post_id.eq(post_id_from))
-      .load::<Self>(conn)
-  }
-}
-
 #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
 #[belongs_to(Comment)]
 #[table_name = "comment_saved"]
index b4200b2d9edad2f064221ac2d2ceee174414d011..7490f366492b479b937fc68c92bee696c5c665a1 100644 (file)
@@ -99,11 +99,6 @@ impl Community {
       .first::<Self>(conn)
   }
 
-  pub fn list_local(conn: &PgConnection) -> Result<Vec<Self>, Error> {
-    use crate::schema::community::dsl::*;
-    community.filter(local.eq(true)).load::<Community>(conn)
-  }
-
   pub fn update_deleted(
     conn: &PgConnection,
     community_id: i32,
index 540841f22b584a7a562c5e0c23c43acd78630223..e68dbd5e2f247342ea003a57613d925bfb5b9ffb 100644 (file)
@@ -386,20 +386,6 @@ pub struct CommunityUserBanView {
 }
 
 impl CommunityUserBanView {
-  pub fn for_community(conn: &PgConnection, from_community_id: i32) -> Result<Vec<Self>, Error> {
-    use super::community_view::community_user_ban_view::dsl::*;
-    community_user_ban_view
-      .filter(community_id.eq(from_community_id))
-      .load::<Self>(conn)
-  }
-
-  pub fn for_user(conn: &PgConnection, from_user_id: i32) -> Result<Vec<Self>, Error> {
-    use super::community_view::community_user_ban_view::dsl::*;
-    community_user_ban_view
-      .filter(user_id.eq(from_user_id))
-      .load::<Self>(conn)
-  }
-
   pub fn get(
     conn: &PgConnection,
     from_user_id: i32,
index edfc26468e10e097b46de8cbd83620e7976781e6..3c22d1776253bdfda6978ef465fc6bd533c5620c 100644 (file)
@@ -50,9 +50,12 @@ pub trait Crud<T> {
   fn update(conn: &PgConnection, id: i32, form: &T) -> Result<Self, Error>
   where
     Self: Sized;
-  fn delete(conn: &PgConnection, id: i32) -> Result<usize, Error>
+  fn delete(_conn: &PgConnection, _id: i32) -> Result<usize, Error>
   where
-    Self: Sized;
+    Self: Sized,
+  {
+    unimplemented!()
+  }
 }
 
 pub trait Followable<T> {
@@ -74,9 +77,6 @@ pub trait Joinable<T> {
 }
 
 pub trait Likeable<T> {
-  fn read(conn: &PgConnection, id: i32) -> Result<Vec<Self>, Error>
-  where
-    Self: Sized;
   fn like(conn: &PgConnection, form: &T) -> Result<Self, Error>
   where
     Self: Sized;
index 33e1063c500185f1c7fa2c9ff3f2792e663bb410..70c253fe3acb34e699b4dee5036072e942d3d52e 100644 (file)
@@ -41,11 +41,6 @@ impl Crud<ModRemovePostForm> for ModRemovePost {
     mod_remove_post.find(from_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, from_id: i32) -> Result<usize, Error> {
-    use crate::schema::mod_remove_post::dsl::*;
-    diesel::delete(mod_remove_post.find(from_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, form: &ModRemovePostForm) -> Result<Self, Error> {
     use crate::schema::mod_remove_post::dsl::*;
     insert_into(mod_remove_post)
@@ -85,11 +80,6 @@ impl Crud<ModLockPostForm> for ModLockPost {
     mod_lock_post.find(from_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, from_id: i32) -> Result<usize, Error> {
-    use crate::schema::mod_lock_post::dsl::*;
-    diesel::delete(mod_lock_post.find(from_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, form: &ModLockPostForm) -> Result<Self, Error> {
     use crate::schema::mod_lock_post::dsl::*;
     insert_into(mod_lock_post)
@@ -129,11 +119,6 @@ impl Crud<ModStickyPostForm> for ModStickyPost {
     mod_sticky_post.find(from_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, from_id: i32) -> Result<usize, Error> {
-    use crate::schema::mod_sticky_post::dsl::*;
-    diesel::delete(mod_sticky_post.find(from_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, form: &ModStickyPostForm) -> Result<Self, Error> {
     use crate::schema::mod_sticky_post::dsl::*;
     insert_into(mod_sticky_post)
@@ -175,11 +160,6 @@ impl Crud<ModRemoveCommentForm> for ModRemoveComment {
     mod_remove_comment.find(from_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, from_id: i32) -> Result<usize, Error> {
-    use crate::schema::mod_remove_comment::dsl::*;
-    diesel::delete(mod_remove_comment.find(from_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, form: &ModRemoveCommentForm) -> Result<Self, Error> {
     use crate::schema::mod_remove_comment::dsl::*;
     insert_into(mod_remove_comment)
@@ -223,11 +203,6 @@ impl Crud<ModRemoveCommunityForm> for ModRemoveCommunity {
     mod_remove_community.find(from_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, from_id: i32) -> Result<usize, Error> {
-    use crate::schema::mod_remove_community::dsl::*;
-    diesel::delete(mod_remove_community.find(from_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, form: &ModRemoveCommunityForm) -> Result<Self, Error> {
     use crate::schema::mod_remove_community::dsl::*;
     insert_into(mod_remove_community)
@@ -277,11 +252,6 @@ impl Crud<ModBanFromCommunityForm> for ModBanFromCommunity {
     mod_ban_from_community.find(from_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, from_id: i32) -> Result<usize, Error> {
-    use crate::schema::mod_ban_from_community::dsl::*;
-    diesel::delete(mod_ban_from_community.find(from_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, form: &ModBanFromCommunityForm) -> Result<Self, Error> {
     use crate::schema::mod_ban_from_community::dsl::*;
     insert_into(mod_ban_from_community)
@@ -329,11 +299,6 @@ impl Crud<ModBanForm> for ModBan {
     mod_ban.find(from_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, from_id: i32) -> Result<usize, Error> {
-    use crate::schema::mod_ban::dsl::*;
-    diesel::delete(mod_ban.find(from_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, form: &ModBanForm) -> Result<Self, Error> {
     use crate::schema::mod_ban::dsl::*;
     insert_into(mod_ban).values(form).get_result::<Self>(conn)
@@ -373,11 +338,6 @@ impl Crud<ModAddCommunityForm> for ModAddCommunity {
     mod_add_community.find(from_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, from_id: i32) -> Result<usize, Error> {
-    use crate::schema::mod_add_community::dsl::*;
-    diesel::delete(mod_add_community.find(from_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, form: &ModAddCommunityForm) -> Result<Self, Error> {
     use crate::schema::mod_add_community::dsl::*;
     insert_into(mod_add_community)
@@ -417,11 +377,6 @@ impl Crud<ModAddForm> for ModAdd {
     mod_add.find(from_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, from_id: i32) -> Result<usize, Error> {
-    use crate::schema::mod_add::dsl::*;
-    diesel::delete(mod_add.find(from_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, form: &ModAddForm) -> Result<Self, Error> {
     use crate::schema::mod_add::dsl::*;
     insert_into(mod_add).values(form).get_result::<Self>(conn)
index 038450bcb10dac5e302831078e84c20c01f6fb61..06615187ea7720ba723d0a743d791d1076826c44 100644 (file)
@@ -28,9 +28,6 @@ impl Crud<PasswordResetRequestForm> for PasswordResetRequest {
       .find(password_reset_request_id)
       .first::<Self>(conn)
   }
-  fn delete(conn: &PgConnection, password_reset_request_id: i32) -> Result<usize, Error> {
-    diesel::delete(password_reset_request.find(password_reset_request_id)).execute(conn)
-  }
   fn create(conn: &PgConnection, form: &PasswordResetRequestForm) -> Result<Self, Error> {
     insert_into(password_reset_request)
       .values(form)
index 591b4cbb04343b89b38438d32540b6a021e108a1..33b78cd6e0ec5576204fdaa8d85334d4e1b171f2 100644 (file)
@@ -1,11 +1,4 @@
-use crate::{
-  naive_now,
-  schema::{post, post_like, post_read, post_saved},
-  Crud,
-  Likeable,
-  Readable,
-  Saveable,
-};
+use crate::{naive_now, schema::{post, post_like, post_read, post_saved}, Crud, Likeable, Saveable, Readable};
 use diesel::{dsl::*, result::Error, *};
 use serde::{Deserialize, Serialize};
 use url::{ParseError, Url};
@@ -201,12 +194,6 @@ pub struct PostLikeForm {
 }
 
 impl Likeable<PostLikeForm> for PostLike {
-  fn read(conn: &PgConnection, post_id_from: i32) -> Result<Vec<Self>, Error> {
-    use crate::schema::post_like::dsl::*;
-    post_like
-      .filter(post_id.eq(post_id_from))
-      .load::<Self>(conn)
-  }
   fn like(conn: &PgConnection, post_like_form: &PostLikeForm) -> Result<Self, Error> {
     use crate::schema::post_like::dsl::*;
     insert_into(post_like)
@@ -264,8 +251,11 @@ impl Saveable<PostSavedForm> for PostSaved {
 #[table_name = "post_read"]
 pub struct PostRead {
   pub id: i32,
+
   pub post_id: i32,
+
   pub user_id: i32,
+
   pub published: chrono::NaiveDateTime,
 }
 
@@ -273,6 +263,7 @@ pub struct PostRead {
 #[table_name = "post_read"]
 pub struct PostReadForm {
   pub post_id: i32,
+
   pub user_id: i32,
 }
 
@@ -283,6 +274,7 @@ impl Readable<PostReadForm> for PostRead {
       .values(post_read_form)
       .get_result::<Self>(conn)
   }
+
   fn mark_as_unread(conn: &PgConnection, post_read_form: &PostReadForm) -> Result<usize, Error> {
     use crate::schema::post_read::dsl::*;
     diesel::delete(
@@ -438,17 +430,17 @@ mod tests {
 
     // Post Read
     let post_read_form = PostReadForm {
-      post_id: inserted_post.id,
-      user_id: inserted_user.id,
-    };
+    post_id: inserted_post.id,
+    user_id: inserted_user.id,
+  };
 
     let inserted_post_read = PostRead::mark_as_read(&conn, &post_read_form).unwrap();
 
     let expected_post_read = PostRead {
-      id: inserted_post_read.id,
-      post_id: inserted_post.id,
-      user_id: inserted_user.id,
-      published: inserted_post_read.published,
+    id: inserted_post_read.id,
+    post_id: inserted_post.id,
+    user_id: inserted_user.id,
+    published: inserted_post_read.published,
     };
 
     let read_post = Post::read(&conn, inserted_post.id).unwrap();
index 9878807a4cfc6c4815d4f870bb99d4c0521e5d8b..c10cdf1e702eb9c0143dd433f4fd44073b30a37c 100644 (file)
@@ -252,11 +252,6 @@ impl<'a> PostQueryBuilder<'a> {
     self
   }
 
-  pub fn unread_only(mut self, unread_only: bool) -> Self {
-    self.unread_only = unread_only;
-    self
-  }
-
   pub fn page<T: MaybeOptional<i64>>(mut self, page: T) -> Self {
     self.page = page.get_optional();
     self
index d9dc047b27f4f9d1b77b22e36cb88ae607520d6b..16c6f9bf86d83e47f0021e825fa6763224afc97b 100644 (file)
@@ -37,11 +37,6 @@ impl Crud<PrivateMessageForm> for PrivateMessage {
     private_message.find(private_message_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, private_message_id: i32) -> Result<usize, Error> {
-    use crate::schema::private_message::dsl::*;
-    diesel::delete(private_message.find(private_message_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, private_message_form: &PrivateMessageForm) -> Result<Self, Error> {
     use crate::schema::private_message::dsl::*;
     insert_into(private_message)
index 51699d657b884676a1b76dd0064f7d79b9143b4f..36b3e833d988cc672e2cc00432850db4e88b1485 100644 (file)
@@ -39,11 +39,6 @@ impl Crud<SiteForm> for Site {
     site.first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, site_id: i32) -> Result<usize, Error> {
-    use crate::schema::site::dsl::*;
-    diesel::delete(site.find(site_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, new_site: &SiteForm) -> Result<Self, Error> {
     use crate::schema::site::dsl::*;
     insert_into(site).values(new_site).get_result::<Self>(conn)
index e8bfa73d6ca36513af35aeedea082c8a34203182..a8ec88d21a22417710f1bf8185d7cd8111e44120 100644 (file)
@@ -28,11 +28,6 @@ impl Crud<UserMentionForm> for UserMention {
     user_mention.find(user_mention_id).first::<Self>(conn)
   }
 
-  fn delete(conn: &PgConnection, user_mention_id: i32) -> Result<usize, Error> {
-    use crate::schema::user_mention::dsl::*;
-    diesel::delete(user_mention.find(user_mention_id)).execute(conn)
-  }
-
   fn create(conn: &PgConnection, user_mention_form: &UserMentionForm) -> Result<Self, Error> {
     use crate::schema::user_mention::dsl::*;
     insert_into(user_mention)
index f304b1769380575103e085cd90ff0e752786432c..08f4c79cfa6acfe17c2f064622c1911c60c0516c 100644 (file)
@@ -159,11 +159,6 @@ impl<'a> UserQueryBuilder<'a> {
 }
 
 impl UserView {
-  pub fn read(conn: &PgConnection, from_user_id: i32) -> Result<Self, Error> {
-    use super::user_view::user_fast::dsl::*;
-    user_fast.find(from_user_id).first::<Self>(conn)
-  }
-
   pub fn admins(conn: &PgConnection) -> Result<Vec<Self>, Error> {
     use super::user_view::user_fast::dsl::*;
     use diesel::sql_types::{Nullable, Text};
index fc50e199b7d2c18a8b960f423d13f1112dd580c0..16d954ff10e8600e24930f7eae02d883f57d79ed 100644 (file)
@@ -12,7 +12,7 @@ pub extern crate url;
 pub mod settings;
 
 use crate::settings::Settings;
-use chrono::{DateTime, FixedOffset, Local, NaiveDateTime, Utc};
+use chrono::{DateTime, FixedOffset, Local, NaiveDateTime};
 use itertools::Itertools;
 use lettre::{
   smtp::{
@@ -43,10 +43,6 @@ macro_rules! location_info {
   };
 }
 
-pub fn to_datetime_utc(ndt: NaiveDateTime) -> DateTime<Utc> {
-  DateTime::<Utc>::from_utc(ndt, Utc)
-}
-
 pub fn naive_from_unix(time: i64) -> NaiveDateTime {
   NaiveDateTime::from_timestamp(time, 0)
 }
index 55b6cbb32a9bd4543ec8718b67bd6fd500ed8cfe..16fd424cbb0b933d6022c09ba0988865fc7e5f91 100644 (file)
@@ -121,10 +121,6 @@ impl Settings {
     )
   }
 
-  pub fn api_endpoint(&self) -> String {
-    format!("{}/api/v1", self.hostname)
-  }
-
   pub fn get_config_defaults_location() -> String {
     env::var("LEMMY_CONFIG_LOCATION").unwrap_or_else(|_| CONFIG_FILE_DEFAULTS.to_string())
   }
index 477ff1d9d5d461cc18b52ffb6ab6dcab271c7585..0f0d05de8d649ef38cb499debaf92bcdc6e85edf 100644 (file)
@@ -1,6 +1,5 @@
-use diesel::{result::Error, PgConnection};
 use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, TokenData, Validation};
-use lemmy_db::{user::User_, Crud};
+use lemmy_db::user::User_;
 use lemmy_utils::settings::Settings;
 use serde::{Deserialize, Serialize};
 
@@ -37,9 +36,4 @@ impl Claims {
     )
     .unwrap()
   }
-
-  pub fn find_by_jwt(conn: &PgConnection, jwt: &str) -> Result<User_, Error> {
-    let claims: Claims = Claims::decode(&jwt).expect("Invalid token").claims;
-    User_::read(&conn, claims.id)
-  }
 }
index 55e0991b6cfeccba280bacf68caa32415316d4b6..f6573a1f486f5ba1ea9f23a6f2ae2fda9aefc34d 100644 (file)
@@ -11,7 +11,6 @@ use crate::{
   },
   blocking,
   request::{retry, RecvError},
-  routes::nodeinfo::{NodeInfo, NodeInfoWellKnown},
   DbPool,
   LemmyError,
 };
@@ -43,20 +42,6 @@ use url::Url;
 static ACTOR_REFETCH_INTERVAL_SECONDS: i64 = 24 * 60 * 60;
 static ACTOR_REFETCH_INTERVAL_SECONDS_DEBUG: i64 = 10;
 
-// Fetch nodeinfo metadata from a remote instance.
-async fn _fetch_node_info(client: &Client, domain: &str) -> Result<NodeInfo, LemmyError> {
-  let well_known_uri = Url::parse(&format!(
-    "{}://{}/.well-known/nodeinfo",
-    get_apub_protocol_string(),
-    domain
-  ))?;
-
-  let well_known = fetch_remote_object::<NodeInfoWellKnown>(client, &well_known_uri).await?;
-  let nodeinfo = fetch_remote_object::<NodeInfo>(client, &well_known.links.href).await?;
-
-  Ok(nodeinfo)
-}
-
 /// Fetch any type of ActivityPub object, handling things like HTTP headers, deserialisation,
 /// timeouts etc.
 pub async fn fetch_remote_object<Response>(
@@ -447,26 +432,3 @@ pub async fn get_or_fetch_and_insert_comment(
     Err(e) => Err(e.into()),
   }
 }
-
-// TODO It should not be fetching data from a community outbox.
-// All posts, comments, comment likes, etc should be posts to our community_inbox
-// The only data we should be periodically fetching (if it hasn't been fetched in the last day
-// maybe), is community and user actors
-// and user actors
-// Fetch all posts in the outbox of the given user, and insert them into the database.
-// fn fetch_community_outbox(community: &Community, conn: &PgConnection) -> Result<Vec<Post>, LemmyError> {
-//   let outbox_url = Url::parse(&community.get_outbox_url())?;
-//   let outbox = fetch_remote_object::<OrderedCollection>(&outbox_url)?;
-//   let items = outbox.collection_props.get_many_items_base_boxes();
-
-//   Ok(
-//     items
-//       .context(location_info!())?
-//       .map(|obox: &BaseBox| -> Result<PostForm, LemmyError> {
-//         let page = obox.clone().to_concrete::<Page>()?;
-//         PostForm::from_page(&page, conn)
-//       })
-//       .map(|pf| upsert_post(&pf?, conn))
-//       .collect::<Result<Vec<Post>, LemmyError>>()?,
-//   )
-// }
index b27ddb9cbcc7fe4359613bbce6ef15fe64186aa5..daa41447ab82625c4989b6f08dc1759f80e285fa 100644 (file)
@@ -1,17 +1,13 @@
-extern crate lemmy_server;
 #[macro_use]
 extern crate diesel_migrations;
 #[macro_use]
 pub extern crate lazy_static;
 
-pub type DbPool = Pool<ConnectionManager<PgConnection>>;
-
-use crate::lemmy_server::actix_web::dev::Service;
 use actix::prelude::*;
 use actix_web::{
   body::Body,
   client::Client,
-  dev::{ServiceRequest, ServiceResponse},
+  dev::{Service, ServiceRequest, ServiceResponse},
   http::{
     header::{CACHE_CONTROL, CONTENT_TYPE},
     HeaderValue,
index 4a7d30993f6a849a4b690b39beb2d2a75db23ddf..c3987145bc2b360808ae75c3ac9885e3629915fb 100644 (file)
@@ -7,15 +7,13 @@ pub mod nodeinfo;
 pub mod webfinger;
 pub mod websocket;
 
-use crate::{rate_limit::rate_limiter::RateLimiter, websocket::server::ChatServer};
+use crate::websocket::server::ChatServer;
 use actix::prelude::*;
 use actix_web::*;
 use diesel::{
   r2d2::{ConnectionManager, Pool},
   PgConnection,
 };
-use std::sync::{Arc, Mutex};
 
 pub type DbPoolParam = web::Data<Pool<ConnectionManager<PgConnection>>>;
-pub type RateLimitParam = web::Data<Arc<Mutex<RateLimiter>>>;
 pub type ChatServerParam = web::Data<Addr<ChatServer>>;