chore: fmt

This commit is contained in:
Levy A.
2025-09-05 02:58:08 -03:00
parent 6d9b57b47e
commit 49eff9a1ca
2 changed files with 4 additions and 3 deletions

View File

@@ -683,7 +683,9 @@ pub fn format_float(v: f64) -> String {
negative.then_some("-").unwrap_or_default(),
if decimal_pos > 0 {
let zeroes = (decimal_pos - digits.len() as i32).max(0) as usize;
let digits = digits.get(0..(decimal_pos.min(digits.len() as i32) as usize)).unwrap();
let digits = digits
.get(0..(decimal_pos.min(digits.len() as i32) as usize))
.unwrap();
(unsafe { str::from_utf8_unchecked(digits) }).to_owned() + &"0".repeat(zeroes)
} else {
"0".to_string()

View File

@@ -18,7 +18,6 @@ use crate::vtab::VirtualTableCursor;
use crate::{turso_assert, Completion, CompletionError, Result, IO};
use std::fmt::{Debug, Display};
/// SQLite by default uses 2000 as maximum numbers in a row.
/// It controlld by the constant called SQLITE_MAX_COLUMN
/// But the hard limit of number of columns is 32,767 columns i16::MAX
@@ -667,7 +666,7 @@ impl PartialEq<Value> for Value {
fn eq(&self, other: &Value) -> bool {
match (self, other) {
(Self::Integer(int_left), Self::Integer(int_right)) => int_left == int_right,
(Self::Integer(int), Self::Float(float)) | (Self::Float(float), Self::Integer(int))=> {
(Self::Integer(int), Self::Float(float)) | (Self::Float(float), Self::Integer(int)) => {
int_float_cmp(*int, *float).is_eq()
}
(Self::Float(float_left), Self::Float(float_right)) => float_left == float_right,