Skip to content

Commit

Permalink
fix(torii-core): client negative i128 conversion (#2840)
Browse files Browse the repository at this point in the history
* fix(torii-core): client negative i128 conversion

* clippy
  • Loading branch information
Larkooo authored Dec 23, 2024
1 parent 6be2d0c commit 02557ae
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/torii/core/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,10 @@ pub fn map_row_to_ty(
let value = row.try_get::<String, &str>(column_name)?;
let hex_str = value.trim_start_matches("0x");

if !hex_str.is_empty() {
primitive.set_i128(Some(
i128::from_str_radix(hex_str, 16).map_err(ParseError::ParseIntError)?,
))?;
}
primitive.set_i128(Some(
u128::from_str_radix(hex_str, 16).map_err(ParseError::ParseIntError)?
as i128,
))?;
}
Primitive::U8(_) => {
let value = row.try_get::<u8, &str>(column_name)?;
Expand Down

0 comments on commit 02557ae

Please sign in to comment.