]> 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 4e0d9c1bdf0628805b9443e5f7bcb39ff4b59bc5..f21c6c48735ce1083005ee2d379dcb1aa384a798 100644 (file)
@@ -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
   }