From 5c94f848f6f9fd867ea6f18b55117c146c648be3 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 29 Jan 2024 18:10:38 -0500 Subject: [PATCH] Switch to failable coversion of numeric types to usize for SQL values --- packages/fuel-indexer-plugin/src/find.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/fuel-indexer-plugin/src/find.rs b/packages/fuel-indexer-plugin/src/find.rs index 51d0ef784..d83e10fac 100644 --- a/packages/fuel-indexer-plugin/src/find.rs +++ b/packages/fuel-indexer-plugin/src/find.rs @@ -336,7 +336,11 @@ macro_rules! impl_number_to_sql_value { ($T:ident) => { impl ToSQLValue for fuel_indexer_types::scalar::$T { fn to_sql_value(self) -> sql::Value { - sqlparser::test_utils::number(&self.to_string()) + sqlparser::test_utils::number( + &usize::try_from(self) + .expect("Could not convert scalar into usize") + .to_string(), + ) } } };