diff options
-rw-r--r-- | src/util.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.rs b/src/util.rs index b17b071..26942cf 100644 --- a/src/util.rs +++ b/src/util.rs @@ -99,7 +99,7 @@ pub fn generate_password(length: usize) -> Result<CString, Error> { } pub fn get_cstring<T: Into<Vec<u8>>>(s: T) -> Result<CString, Error> { - CString::new(s).or_else(|_| Err(LibraryError::InvalidString.into())) + CString::new(s).map_err(|_| LibraryError::InvalidString.into()) } impl Into<i32> for LogLevel { |