Skip to content

Commit

Permalink
ci: fix clippy warning on 1.83 (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt authored Dec 5, 2024
1 parent 9d72f5d commit 94c7c55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ fn invoke_scalar<I>(
Ok(ColumnarValue::Scalar(to_scalar(v)))
}
ScalarValue::Union(type_id_value, union_fields, _) => {
let opt_json = json_from_union_scalar(type_id_value, union_fields);
let opt_json = json_from_union_scalar(type_id_value.as_ref(), union_fields);
let v = jiter_find(opt_json, &JsonPath::extract_path(args)).ok();
Ok(ColumnarValue::Scalar(to_scalar(v)))
}
Expand Down
6 changes: 3 additions & 3 deletions src/common_union.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ pub(crate) fn nested_json_array(array: &ArrayRef, object_lookup: bool) -> Option

/// Extract a JSON string from a `JsonUnion` scalar
pub(crate) fn json_from_union_scalar<'a>(
type_id_value: &'a Option<(i8, Box<ScalarValue>)>,
type_id_value: Option<&'a (i8, Box<ScalarValue>)>,
fields: &UnionFields,
) -> Option<&'a str> {
if let Some((type_id, value)) = type_id_value {
// we only want to take teh ScalarValue string if the type_id indicates the value represents nested JSON
// we only want to take the ScalarValue string if the type_id indicates the value represents nested JSON
if fields == &union_fields() && (*type_id == TYPE_ID_ARRAY || *type_id == TYPE_ID_OBJECT) {
if let ScalarValue::Utf8(s) = value.as_ref() {
return s.as_ref().map(String::as_str);
return s.as_deref();
}
}
}
Expand Down

0 comments on commit 94c7c55

Please sign in to comment.