Skip to content

Commit f08d086

Browse files
authored
Bump dep redismodule-rs to v1.0.0 (RedisJSON#663)
1 parent cc266e6 commit f08d086

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

Cargo.lock

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ serde_json = "1.0"
2424
serde = "1.0"
2525
libc = "0.2"
2626
jsonpath_lib = { git = "https://github.com/RedisJSON/jsonpath.git", branch = "generic_json_path" }
27-
#redis-module = { version="0.26", features = ["experimental-api"]}
28-
redis-module = { git = "https://github.com/RedisLabsModules/redismodule-rs.git", branch="master", features = ["experimental-api"]}
27+
redis-module = { version="1.0", features = ["experimental-api"]}
2928
itertools = "0.10.1"
3029
[features]
3130
# Workaround to allow cfg(feature = "test") in redismodue-rs dependencies:

src/c_api.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -521,16 +521,16 @@ macro_rules! redis_json_module_export_shared_api {
521521
static REDISJSON_GETAPI: &str = concat!("RedisJSON_V1", "\0");
522522

523523
pub fn export_shared_api(ctx: &Context) {
524-
ctx.log_notice("Exported RedisJSON_V1 API");
525524
unsafe {
525+
ctx.log_notice("Exported RedisJSON_V1 API");
526526
LLAPI_CTX = Some(rawmod::RedisModule_GetThreadSafeContext.unwrap()(
527527
std::ptr::null_mut(),
528-
))
529-
};
530-
ctx.export_shared_api(
531-
&JSONAPI as *const RedisJSONAPI_V1 as *const c_void,
532-
REDISJSON_GETAPI.as_ptr() as *const c_char,
533-
);
528+
));
529+
ctx.export_shared_api(
530+
&JSONAPI as *const RedisJSONAPI_V1 as *const c_void,
531+
REDISJSON_GETAPI.as_ptr() as *const c_char,
532+
);
533+
}
534534
}
535535

536536
static JSONAPI: RedisJSONAPI_V1 = RedisJSONAPI_V1 {

src/commands.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,7 @@ pub fn command_json_clear<M: Manager>(
18991899
SelectValueType::Array | SelectValueType::Object => v.len().unwrap() > 0,
19001900
SelectValueType::Long => v.get_long() != 0,
19011901
SelectValueType::Double => v.get_double() != 0.0,
1902-
SelectValueType::String => v.get_str().len() > 0,
1902+
SelectValueType::String => !v.get_str().is_empty(),
19031903
SelectValueType::Bool => v.get_bool(),
19041904
_ => false,
19051905
})?;

src/ivalue_manager.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fn update<F: FnMut(&mut IValue) -> Result<Option<()>, Error>>(
133133
let mut v = e.get_mut();
134134
match (func)(&mut v) {
135135
Ok(res) => {
136-
if let None = res {
136+
if res.is_none() {
137137
e.remove();
138138
}
139139
}
@@ -152,7 +152,7 @@ fn update<F: FnMut(&mut IValue) -> Result<Option<()>, Error>>(
152152
let mut v = &mut arr.as_mut_slice()[x];
153153
match (func)(&mut v) {
154154
Ok(res) => {
155-
if let None = res {
155+
if res.is_none() {
156156
arr.remove(x);
157157
}
158158
}

0 commit comments

Comments
 (0)