Skip to content

Commit

Permalink
Fix handle Set type
Browse files Browse the repository at this point in the history
Signed-off-by: umit <[email protected]>
  • Loading branch information
umit committed Oct 10, 2024
1 parent fa920cc commit c6b21fc
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions go/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ fn valkey_value_to_command_response(value: Value) -> RedisResult<CommandResponse
command_response.response_type = ResponseType::Bool;
Ok(command_response)
}
Value::Array(array) => {
Value::Array(array) | Value::Set(array) => {
let vec: Vec<CommandResponse> = array
.into_iter()
.map(|v| {
Expand Down Expand Up @@ -453,20 +453,6 @@ fn valkey_value_to_command_response(value: Value) -> RedisResult<CommandResponse
command_response.response_type = ResponseType::Map;
Ok(command_response)
}
Value::Set(array) => {
let vec: Vec<CommandResponse> = array
.into_iter()
.map(|v| {
valkey_value_to_command_response(v)
.expect("Value couldn't be converted to CommandResponse")
})
.collect();
let (vec_ptr, len) = convert_vec_to_pointer(vec);
command_response.array_value = vec_ptr;
command_response.array_value_len = len;
command_response.response_type = ResponseType::Array;
Ok(command_response)
}
// TODO: Add support for other return types.
_ => todo!(),
};
Expand Down

0 comments on commit c6b21fc

Please sign in to comment.