From 501e7e297a47a455c229e2967b8b49e135bfcdbd Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Wed, 14 Aug 2024 16:10:25 +0000 Subject: [PATCH] Merge pull request #4166 from guissalustiano/remove_cast_in_array avoid integer cast in `ToSql::, Pg>` --- diesel/src/pg/types/array.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diesel/src/pg/types/array.rs b/diesel/src/pg/types/array.rs index 8afcf878151f..c3141cb5ca7d 100644 --- a/diesel/src/pg/types/array.rs +++ b/diesel/src/pg/types/array.rs @@ -101,7 +101,7 @@ where out.write_i32::(flags)?; let element_oid = Pg::metadata(out.metadata_lookup()).oid()?; out.write_u32::(element_oid)?; - out.write_i32::(self.len() as i32)?; + out.write_i32::(self.len().try_into()?)?; let lower_bound = 1; out.write_i32::(lower_bound)?;