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)?;