Skip to content

Commit 0a1b698

Browse files
committed
fix
1 parent fcbcd24 commit 0a1b698

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/db/delete.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,17 @@ async fn delete_crate_from_database(
187187
.execute(&mut *transaction)
188188
.await?;
189189

190-
let has_library = sqlx::query_scalar(
190+
let has_library: bool = sqlx::query_scalar!(
191191
"SELECT
192-
BOOL_OR(releases.is_library) AS has_library
193-
FROM releases
194-
WHERE releases.crate_id = $1
195-
",
192+
BOOL_OR(releases.is_library) AS has_library
193+
FROM releases
194+
WHERE releases.crate_id = $1
195+
",
196+
crate_id
196197
)
197-
.bind(crate_id)
198198
.fetch_one(&mut *transaction)
199-
.await?; // TODO: unwrapo_or_false?
199+
.await?
200+
.unwrap_or(false);
200201

201202
sqlx::query!("DELETE FROM releases WHERE crate_id = $1;", crate_id)
202203
.execute(&mut *transaction)

0 commit comments

Comments
 (0)