Skip to content

Commit be5f3d3

Browse files
committed
add ParseIntError to RedisError
1 parent 76eef29 commit be5f3d3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/redismodule.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::ffi::CString;
22
use std::slice;
33
use std::str;
4-
use core::num::ParseFloatError;
4+
use core::num::{ParseFloatError, ParseIntError};
55

66
pub type RedisResult = Result<RedisValue, RedisError>;
77

@@ -26,6 +26,12 @@ impl From<ParseFloatError> for RedisError {
2626
}
2727
}
2828

29+
impl From<ParseIntError> for RedisError {
30+
fn from(e: ParseIntError) -> Self {
31+
RedisError::String(e.to_string())
32+
}
33+
}
34+
2935
#[derive(Debug, PartialEq)]
3036
pub enum RedisValue {
3137
SimpleStringStatic(&'static str),

0 commit comments

Comments
 (0)