From dc7dfc61ec839175ebb51fcbaef1156fea5fdcf4 Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 9 Jul 2023 22:21:12 +0300 Subject: cargo update, part 1 --- kittybox-rs/src/webmentions/queue.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'kittybox-rs/src/webmentions/queue.rs') diff --git a/kittybox-rs/src/webmentions/queue.rs b/kittybox-rs/src/webmentions/queue.rs index 0b11a4e..3ced831 100644 --- a/kittybox-rs/src/webmentions/queue.rs +++ b/kittybox-rs/src/webmentions/queue.rs @@ -54,13 +54,13 @@ impl Drop for PostgresJob { .push(" WHERE id = ") .push_bind(id) .build() - .execute(&mut txn) + .execute(&mut *txn) .await .unwrap(); sqlx::query_builder::QueryBuilder::new("NOTIFY ") .push(T::NOTIFICATION_CHANNEL) .build() - .execute(&mut txn) + .execute(&mut *txn) .await .unwrap(); txn.commit().await.unwrap(); @@ -79,7 +79,7 @@ impl PostgresJob { .build_query_as::<(i32,)>() // It's safe to unwrap here, because we "take" the txn only on drop or commit, // where it's passed by value, not by reference. - .fetch_one(self.txn.as_mut().unwrap()) + .fetch_one(self.txn.as_deref_mut().unwrap()) .await .map(|(i,)| i as usize) } @@ -94,7 +94,7 @@ impl Job> for PostgresJob { tracing::debug!("Deleting {} from the job queue", self.id); sqlx::query("DELETE FROM kittybox.incoming_webmention_queue WHERE id = $1") .bind(self.id) - .execute(self.txn.as_mut().unwrap()) + .execute(self.txn.as_deref_mut().unwrap()) .await?; self.txn.take().unwrap().commit().await @@ -149,7 +149,7 @@ impl JobQueue for PostgresJobQueue { match sqlx::query_as::<_, PostgresJobRow>( "SELECT id, source, target FROM kittybox.incoming_webmention_queue WHERE attempts < 5 FOR UPDATE SKIP LOCKED LIMIT 1" ) - .fetch_optional(&mut txn) + .fetch_optional(&mut *txn) .await? { Some(job_row) => { -- cgit 1.4.1