Skip to content

Commit

Permalink
Always annotate transaction callback return type
Browse files Browse the repository at this point in the history
It's easier this way, less coupling between the annotation and the
callback's usage of returns.
  • Loading branch information
GrantGryczan committed Oct 28, 2024
1 parent 6d17ae3 commit 57d95d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/routes/v1/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
Json, Response,
},
crypto::{hash_with_salt, verify_hash},
db::{self, TxError},
db::{self, TxError, TxResult},
id::NewUserId,
};

Expand Down Expand Up @@ -47,7 +47,7 @@ pub async fn post(Json(body): Json<PostRequest>) -> Response<PostResponse> {

let password_hash = hash_with_salt(&body.password)?;

db::transaction!(async |tx| {
db::transaction!(async |tx| -> TxResult<_, api::Error> {
let does_code_match = sqlx::query!(
"DELETE FROM unverified_emails
WHERE user_id IS NULL AND email = $1
Expand Down

0 comments on commit 57d95d1

Please sign in to comment.