mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 17:05:36 +01:00
chore: fmt
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user