mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-15 04:54:20 +01:00
fmt,clippy
clippy
This commit is contained in:
@@ -65,11 +65,11 @@ pub fn exec_printf(values: &[Register]) -> crate::Result<Value> {
|
||||
return Err(LimboError::InvalidArgument("not enough arguments".into()));
|
||||
}
|
||||
let value = &values[args_index].get_value();
|
||||
match value {
|
||||
Value::Integer(i) => result.push_str(&format!("{}", i)),
|
||||
match value {
|
||||
Value::Integer(i) => result.push_str(&format!("{i}")),
|
||||
Value::Float(f) => {
|
||||
let truncated_val = *f as i64;
|
||||
result.push_str(&format!("{}", truncated_val));
|
||||
result.push_str(&format!("{truncated_val}"));
|
||||
}
|
||||
_ => result.push('0'),
|
||||
}
|
||||
@@ -314,8 +314,7 @@ mod tests {
|
||||
vec![text("Number: %d"), text("not a number")],
|
||||
text("Number: 0"),
|
||||
),
|
||||
|
||||
(
|
||||
(
|
||||
vec![text("Truncated float: %d"), float(3.9)],
|
||||
text("Truncated float: 3"),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user