Skip to content

Commit

Permalink
use try_from in range
Browse files Browse the repository at this point in the history
  • Loading branch information
guissalustiano authored and weiznich committed Aug 23, 2024
1 parent 501e7e2 commit 48cc9e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diesel/src/pg/types/ranges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ where

if !flags.contains(RangeFlags::LB_INF) {
let elem_size = bytes.read_i32::<NetworkEndian>()?;
let (elem_bytes, new_bytes) = bytes.split_at(elem_size as usize);
let (elem_bytes, new_bytes) = bytes.split_at(elem_size.try_into()?);
bytes = new_bytes;
let value = T::from_sql(PgValue::new_internal(elem_bytes, &value))?;

Expand Down

0 comments on commit 48cc9e6

Please sign in to comment.