~ireas/nitrokey-rs

b2607cbd3f239be9d09204921db278424cc7a6be — Robin Krahl 1 year, 3 months ago e9a89be
Use map_err(|_| x) instead of or_else(|_| Err(x))
1 files changed, 1 insertions(+), 1 deletions(-)

M src/util.rs
M src/util.rs => src/util.rs +1 -1
@@ 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 {