From 2a9b85889e2f4f63512f3ff6695526e3d1e5a326 Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Fri, 16 Aug 2024 14:08:13 -0700 Subject: [PATCH] fix: audit `sqlx_postgres::type::int` for bad casts --- sqlx-postgres/src/types/int.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sqlx-postgres/src/types/int.rs b/sqlx-postgres/src/types/int.rs index 465d040f0..b8255f1b0 100644 --- a/sqlx-postgres/src/types/int.rs +++ b/sqlx-postgres/src/types/int.rs @@ -71,6 +71,8 @@ impl Decode<'_, Postgres> for i8 { return Ok(i8::from_str_radix(text.trim_start_matches('\\'), 8)?); } + // Wrapping is the whole idea. + #[allow(clippy::cast_possible_wrap)] Ok(text.as_bytes()[0] as i8) } }