]> Untitled Git - lemmy.git/blobdiff - lemmy_api_structs/src/lib.rs
Isomorphic docker (#1124)
[lemmy.git] / lemmy_api_structs / src / lib.rs
similarity index 91%
rename from server/lemmy_api_structs/src/lib.rs
rename to lemmy_api_structs/src/lib.rs
index e94a286f770bbfbcb6133a99f8db5b0e0355407c..dd2a78cda131fc7fe319c00ef59472da1aa32df6 100644 (file)
@@ -1,7 +1,7 @@
-extern crate serde;
-extern crate log;
-extern crate diesel;
 extern crate actix_web;
+extern crate diesel;
+extern crate log;
+extern crate serde;
 
 pub mod comment;
 pub mod community;
@@ -9,22 +9,22 @@ pub mod post;
 pub mod site;
 pub mod user;
 
-use lemmy_db::comment::Comment;
-use lemmy_db::user::User_;
-use lemmy_db::post::Post;
-use lemmy_db::user_mention::{UserMentionForm, UserMention};
-use log::error;
-use lemmy_db::{Crud, DbPool};
-use lemmy_utils::utils::MentionData;
-use lemmy_utils::settings::Settings;
-use lemmy_utils::email::send_email;
 use diesel::PgConnection;
-use lemmy_utils::LemmyError;
+use lemmy_db::{
+  comment::Comment,
+  post::Post,
+  user::User_,
+  user_mention::{UserMention, UserMentionForm},
+  Crud,
+  DbPool,
+};
+use lemmy_utils::{email::send_email, settings::Settings, utils::MentionData, LemmyError};
+use log::error;
 
 pub async fn blocking<F, T>(pool: &DbPool, f: F) -> Result<T, LemmyError>
-  where
-    F: FnOnce(&diesel::PgConnection) -> T + Send + 'static,
-    T: Send + 'static,
+where
+  F: FnOnce(&diesel::PgConnection) -> T + Send + 'static,
+  T: Send + 'static,
 {
   let pool = pool.clone();
   let res = actix_web::web::block(move || {
@@ -32,7 +32,7 @@ pub async fn blocking<F, T>(pool: &DbPool, f: F) -> Result<T, LemmyError>
     let res = (f)(&conn);
     Ok(res) as Result<_, LemmyError>
   })
-    .await?;
+  .await?;
 
   Ok(res)
 }
@@ -49,7 +49,7 @@ pub async fn send_local_notifs(
   let ids = blocking(pool, move |conn| {
     do_send_local_notifs(conn, &mentions, &comment, &user2, &post, do_send_email)
   })
-    .await?;
+  .await?;
 
   Ok(ids)
 }