diff --git a/core/numeric/mod.rs b/core/numeric/mod.rs index 59956ad22..1e823b1c2 100644 --- a/core/numeric/mod.rs +++ b/core/numeric/mod.rs @@ -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() diff --git a/core/types.rs b/core/types.rs index 55979748f..6cc406608 100644 --- a/core/types.rs +++ b/core/types.rs @@ -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 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,