]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/impls/secret.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / db_schema / src / impls / secret.rs
index 0c005c096524d7d51ab53b06f13e209a8d9499d0..f21c6c48735ce1083005ee2d379dcb1aa384a798 100644 (file)
@@ -1,5 +1,5 @@
 use crate::{
-  schema::secret::dsl::*,
+  schema::secret::dsl::secret,
   source::secret::Secret,
   utils::{get_conn, DbPool},
 };
@@ -9,11 +9,11 @@ use diesel_async::RunQueryDsl;
 impl Secret {
   /// Initialize the Secrets from the DB.
   /// Warning: You should only call this once.
-  pub async fn init(pool: &DbPool) -> Result<Secret, Error> {
+  pub async fn init(pool: &mut DbPool<'_>) -> Result<Secret, Error> {
     Self::read_secrets(pool).await
   }
 
-  async fn read_secrets(pool: &DbPool) -> Result<Secret, Error> {
+  async fn read_secrets(pool: &mut DbPool<'_>) -> Result<Secret, Error> {
     let conn = &mut get_conn(pool).await?;
     secret.first::<Secret>(conn).await
   }