Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Switch to failable coversion of numeric types to usize for SQL values
Browse files Browse the repository at this point in the history
  • Loading branch information
deekerno committed Jan 29, 2024
1 parent cdbc4a3 commit 5c94f84
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/fuel-indexer-plugin/src/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
}
}
};
Expand Down

0 comments on commit 5c94f84

Please sign in to comment.