mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-17 08:34:19 +01:00
clippy fix
This commit is contained in:
@@ -80,7 +80,7 @@ where
|
||||
{
|
||||
let values = values.into_iter();
|
||||
if values.len() == 0 {
|
||||
let now = parse_naive_date_time(&Value::build_text("now")).unwrap();
|
||||
let now = parse_naive_date_time(Value::build_text("now")).unwrap();
|
||||
return format_dt(now, output_type, false);
|
||||
}
|
||||
let mut values = values.peekable();
|
||||
@@ -1023,7 +1023,7 @@ mod tests {
|
||||
];
|
||||
|
||||
for case in invalid_cases.iter() {
|
||||
let result = exec_date(&[case]);
|
||||
let result = exec_date([case]);
|
||||
match result {
|
||||
Value::Text(ref result_str) if result_str.value.is_empty() => (),
|
||||
_ => panic!("Expected empty string for input: {case:?}, but got: {result:?}"),
|
||||
|
||||
@@ -1031,7 +1031,7 @@ mod tests {
|
||||
fn test_json_extract_missing_path() {
|
||||
let json_cache = JsonCacheCell::new();
|
||||
let result = json_extract(
|
||||
&Value::build_text("{\"a\":2}"),
|
||||
Value::build_text("{\"a\":2}"),
|
||||
&[Value::build_text("$.x")],
|
||||
&json_cache,
|
||||
);
|
||||
@@ -1044,7 +1044,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_json_extract_null_path() {
|
||||
let json_cache = JsonCacheCell::new();
|
||||
let result = json_extract(&Value::build_text("{\"a\":2}"), &[Value::Null], &json_cache);
|
||||
let result = json_extract(Value::build_text("{\"a\":2}"), &[Value::Null], &json_cache);
|
||||
|
||||
match result {
|
||||
Ok(Value::Null) => (),
|
||||
@@ -1056,7 +1056,7 @@ mod tests {
|
||||
fn test_json_path_invalid() {
|
||||
let json_cache = JsonCacheCell::new();
|
||||
let result = json_extract(
|
||||
&Value::build_text("{\"a\":2}"),
|
||||
Value::build_text("{\"a\":2}"),
|
||||
&[Value::Float(1.1)],
|
||||
&json_cache,
|
||||
);
|
||||
|
||||
@@ -325,7 +325,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'b, V: AsValueRef> AsValueRef for &'b V {
|
||||
impl<V: AsValueRef> AsValueRef for &V {
|
||||
fn as_value_ref<'a>(&'a self) -> ValueRef<'a> {
|
||||
(*self).as_value_ref()
|
||||
}
|
||||
|
||||
@@ -4967,7 +4967,7 @@ pub fn op_function(
|
||||
let start = state.registers[*start_reg].get_value();
|
||||
let end = state.registers[*start_reg + 1].get_value();
|
||||
|
||||
let result = crate::functions::datetime::exec_timediff(&[start, end]);
|
||||
let result = crate::functions::datetime::exec_timediff([start, end]);
|
||||
|
||||
state.registers[*dest] = Register::Value(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user