Skip to content

Commit

Permalink
Merge pull request #4166 from guissalustiano/remove_cast_in_array
Browse files Browse the repository at this point in the history
avoid integer cast in `ToSql::<Array<_>, Pg>`
  • Loading branch information
weiznich committed Aug 23, 2024
1 parent 7171ba1 commit 501e7e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diesel/src/pg/types/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ where
out.write_i32::<NetworkEndian>(flags)?;
let element_oid = Pg::metadata(out.metadata_lookup()).oid()?;
out.write_u32::<NetworkEndian>(element_oid)?;
out.write_i32::<NetworkEndian>(self.len() as i32)?;
out.write_i32::<NetworkEndian>(self.len().try_into()?)?;
let lower_bound = 1;
out.write_i32::<NetworkEndian>(lower_bound)?;

Expand Down

0 comments on commit 501e7e2

Please sign in to comment.