X-Git-Url: http://these/git/?a=blobdiff_plain;f=lemmy_api_structs%2Fsrc%2Flib.rs;fp=server%2Flemmy_api_structs%2Fsrc%2Flib.rs;h=dd2a78cda131fc7fe319c00ef59472da1aa32df6;hb=5c6258390c46159c16f49295314c6519215fc6ae;hp=e94a286f770bbfbcb6133a99f8db5b0e0355407c;hpb=b69524b498983da636b3a31f5acb74fbb1f13ab4;p=lemmy.git diff --git a/server/lemmy_api_structs/src/lib.rs b/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 e94a286f..dd2a78cd 100644 --- a/server/lemmy_api_structs/src/lib.rs +++ b/lemmy_api_structs/src/lib.rs @@ -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(pool: &DbPool, f: F) -> Result - 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(pool: &DbPool, f: F) -> Result 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) }