From 02557aee098cb5abf6431665c6af8d0588b64128 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Tue, 24 Dec 2024 00:14:45 +0700 Subject: [PATCH] fix(torii-core): client negative i128 conversion (#2840) * fix(torii-core): client negative i128 conversion * clippy --- crates/torii/core/src/model.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/torii/core/src/model.rs b/crates/torii/core/src/model.rs index 5030128013..2b2c8f0bc8 100644 --- a/crates/torii/core/src/model.rs +++ b/crates/torii/core/src/model.rs @@ -270,11 +270,10 @@ pub fn map_row_to_ty( let value = row.try_get::(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::(column_name)?;