Skip to content

Commit

Permalink
Address PR comments.
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand committed Jan 8, 2025
1 parent f3fb567 commit 4e47814
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions glide-core/src/client/value_conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,9 @@ fn convert_flat_array_to_array_of_pairs(
Ok(Value::Array(result))
}

const IS_ARRAY: &'static (dyn Fn(Value) -> bool + Sync) = &|val| matches!(val, Value::Array(_));
fn is_array(val: Value) -> bool {
matches!(val, Value::Array(_))
}

pub(crate) fn expected_type_for_cmd(cmd: &Cmd) -> Option<ExpectedReturnType> {
let command = cmd.command()?;
Expand All @@ -1405,7 +1407,7 @@ pub(crate) fn expected_type_for_cmd(cmd: &Cmd) -> Option<ExpectedReturnType> {
key_type: &None,
value_type: &None,
}),
Some(&IS_ARRAY),
Some(&is_array),
)),
b"XCLAIM" => {
if cmd.position(b"JUSTID").is_some() {
Expand Down Expand Up @@ -1499,7 +1501,7 @@ pub(crate) fn expected_type_for_cmd(cmd: &Cmd) -> Option<ExpectedReturnType> {
))),
b"FUNCTION STATS" => Some(ExpectedReturnType::SingleOrMultiNode(
&Some(ExpectedReturnType::FunctionStatsReturnType),
Some(&IS_ARRAY),
Some(&is_array),
)),
b"GEOSEARCH" => {
if cmd.position(b"WITHDIST").is_some()
Expand Down

0 comments on commit 4e47814

Please sign in to comment.