Skip to content

Commit 4c354da

Browse files
committed
add into() from parse error to error
1 parent a4b764e commit 4c354da

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/redismodule.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::ffi::CString;
22
use std::slice;
33
use std::str;
4+
use core::num::ParseFloatError;
45

56
pub type RedisResult = Result<RedisValue, RedisError>;
67

@@ -19,6 +20,12 @@ impl From<&'static str> for RedisError {
1920
}
2021
}
2122

23+
impl From<ParseFloatError> for RedisError {
24+
fn from(e: ParseFloatError) -> Self {
25+
RedisError::String(e.to_string())
26+
}
27+
}
28+
2229
#[derive(Debug, PartialEq)]
2330
pub enum RedisValue {
2431
SimpleStringStatic(&'static str),

0 commit comments

Comments
 (0)