Skip to content

Commit b7a9c5b

Browse files
author
Meir Shpilraien (Spielrein)
authored
Fix is_enterprise function (#369)
1 parent 6be84d1 commit b7a9c5b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/context/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -855,10 +855,12 @@ impl Context {
855855
/// Return error in case it was not possible to determind the deployment.
856856
fn is_enterprise_internal(&self) -> Result<bool, RedisError> {
857857
let info_res = self.call("info", &["server"])?;
858-
match info_res {
859-
RedisValue::BulkRedisString(res) => Ok(res.try_as_str()?.contains("rlec_version:")),
860-
_ => Err(RedisError::Str("Mismatch call reply type")),
861-
}
858+
let info = match &info_res {
859+
RedisValue::BulkRedisString(res) => res.try_as_str()?,
860+
RedisValue::SimpleString(res) => res.as_str(),
861+
_ => return Err(RedisError::Str("Mismatch call reply type")),
862+
};
863+
Ok(info.contains("rlec_version:"))
862864
}
863865

864866
/// Return `true` is the current Redis deployment is enterprise, otherwise `false`.

0 commit comments

Comments
 (0)