about summary refs log tree commit diff
path: root/src/database/postgres
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-08-26 20:25:20 +0300
committerVika <vika@fireburn.ru>2024-08-26 20:25:20 +0300
commit806f5fbfabd914d27ff3fb2e822e1c3869068859 (patch)
treecc805cfb7ef5af3d7e26075106d2663e5ca2dd67 /src/database/postgres
parent14e58b4137f8f77af43cad8b712596c2e1ab7e8a (diff)
downloadkittybox-806f5fbfabd914d27ff3fb2e822e1c3869068859.tar.zst
Set MSRV to 1.75, remove #[async_trait] declarations whenever possible
Axum still uses `async_trait`, let them do whatever they want. I will
no longer be subject to the humiliation of trying to dig through
lifetime errors and unreadable declarations. Also I don't fucking care
about MSRV, I'm not a library. If you don't have modern Rust, get one.
Diffstat (limited to 'src/database/postgres')
-rw-r--r--src/database/postgres/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/database/postgres/mod.rs b/src/database/postgres/mod.rs
index b2d4339..83e04c7 100644
--- a/src/database/postgres/mod.rs
+++ b/src/database/postgres/mod.rs
@@ -45,7 +45,6 @@ impl PostgresStorage {
     }
 }
 
-#[async_trait::async_trait]
 impl Storage for PostgresStorage {
     /// Construct a new [`PostgresStorage`] from an URI string and run
     /// migrations on the database.
@@ -189,8 +188,9 @@ WHERE
 
         txn.commit().await.map_err(Into::into)
     }
+
     #[tracing::instrument(skip(self))]
-    async fn update_post(&self, url: &'_ str, update: MicropubUpdate) -> Result<()> {
+    async fn update_post(&self, url: &str, update: MicropubUpdate) -> Result<()> {
         tracing::debug!("Updating post {}", url);
         let mut txn = self.db.begin().await?;
         let (uid, mut post) = sqlx::query_as::<_, (String, serde_json::Value)>("SELECT uid, mf2 FROM kittybox.mf2_json WHERE uid = $1 OR mf2['properties']['url'] ? $1 FOR UPDATE")
@@ -348,7 +348,7 @@ LIMIT $2"
     }
 
     #[tracing::instrument(skip(self))]
-    async fn get_setting<S: Setting<'a>, 'a>(&'_ self, user: &url::Url) -> Result<S> {
+    async fn get_setting<S: Setting>(&'_ self, user: &url::Url) -> Result<S> {
         match sqlx::query_as::<_, (serde_json::Value,)>("SELECT kittybox.get_setting($1, $2)")
             .bind(user.authority())
             .bind(S::ID)
@@ -361,7 +361,7 @@ LIMIT $2"
     }
 
     #[tracing::instrument(skip(self))]
-    async fn set_setting<S: Setting<'a> + 'a, 'a>(&self, user: &'a url::Url, value: S::Data) -> Result<()> {
+    async fn set_setting<S: Setting>(&self, user: &url::Url, value: S::Data) -> Result<()> {
         sqlx::query("SELECT kittybox.set_setting($1, $2, $3)")
             .bind(user.authority())
             .bind(S::ID)