clippy fix

This commit is contained in:
pedrocarlo
2025-11-11 13:50:53 -03:00
parent 84268c155b
commit e1d36a2221
4 changed files with 7 additions and 7 deletions

View File

@@ -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:?}"),

View File

@@ -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,
);

View File

@@ -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()
}

View File

@@ -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);
}