Skip to content

Commit 9159c05

Browse files
committed
remove breaking changes
1 parent cadcfb1 commit 9159c05

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ serde = { version = "1", features = ["derive"] }
133133
nix = { version = "0.26", default-features = false }
134134
cfg-if = "1"
135135
redis-module-macros-internals = { path = "./redismodule-rs-macros-internals" }
136-
strum = {version = "0.27.2",features = ["derive"]}
137136
log = "0.4"
138137

139138
[dev-dependencies]

build.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@ impl ParseCallbacks for RedisModuleCallback {
1212
fn int_macro(&self, name: &str, _value: i64) -> Option<IntKind> {
1313
if name.starts_with("REDISMODULE_SUBEVENT_") || name.starts_with("REDISMODULE_EVENT_") {
1414
Some(IntKind::U64)
15-
} else if name.starts_with("REDISMODULE_REPLY") {
16-
Some(IntKind::I32)
15+
} else if name.starts_with("REDISMODULE_REPLY_")
16+
|| name.starts_with("REDISMODULE_KEYTYPE_")
17+
|| name.starts_with("REDISMODULE_AUX_")
18+
|| name == "REDISMODULE_OK"
19+
|| name == "REDISMODULE_ERR"
20+
|| name == "REDISMODULE_LIST_HEAD"
21+
|| name == "REDISMODULE_LIST_TAIL"
22+
{
23+
// These values are used as `enum` discriminants, and thus must be `isize`.
24+
Some(IntKind::Custom {
25+
name: "isize",
26+
is_signed: true,
27+
})
1728
} else if name.starts_with("REDISMODULE_NOTIFY_") {
1829
Some(IntKind::Int)
1930
} else {

src/raw.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ bitflags! {
4040
}
4141
}
4242

43-
#[repr(u32)]
44-
#[derive(Primitive, Debug, PartialEq, Eq, strum::FromRepr)]
43+
#[derive(Primitive, Debug, PartialEq, Eq)]
4544
pub enum KeyType {
4645
Empty = REDISMODULE_KEYTYPE_EMPTY,
4746
String = REDISMODULE_KEYTYPE_STRING,
@@ -59,8 +58,7 @@ impl From<c_int> for KeyType {
5958
}
6059
}
6160

62-
#[repr(u32)]
63-
#[derive(Primitive, Debug, PartialEq, Eq, strum::FromRepr)]
61+
#[derive(Primitive, Debug, PartialEq, Eq)]
6462
pub enum Where {
6563
ListHead = REDISMODULE_LIST_HEAD,
6664
ListTail = REDISMODULE_LIST_TAIL,
@@ -89,15 +87,13 @@ impl From<c_int> for ReplyType {
8987
}
9088
}
9189

92-
#[repr(u32)]
93-
#[derive(Primitive, Debug, PartialEq, Eq, strum::FromRepr)]
90+
#[derive(Primitive, Debug, PartialEq, Eq)]
9491
pub enum Aux {
9592
Before = REDISMODULE_AUX_BEFORE_RDB,
9693
After = REDISMODULE_AUX_AFTER_RDB,
9794
}
9895

99-
#[repr(u32)]
100-
#[derive(Primitive, Debug, PartialEq, Eq, strum::FromRepr)]
96+
#[derive(Primitive, Debug, PartialEq, Eq)]
10197
pub enum Status {
10298
Ok = REDISMODULE_OK,
10399
Err = REDISMODULE_ERR,

0 commit comments

Comments
 (0)