From b2607cbd3f239be9d09204921db278424cc7a6be Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 30 Aug 2020 18:52:15 +0200 Subject: Use map_err(|_| x) instead of or_else(|_| Err(x)) --- src/util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 { } pub fn get_cstring>>(s: T) -> Result { - CString::new(s).or_else(|_| Err(LibraryError::InvalidString.into())) + CString::new(s).map_err(|_| LibraryError::InvalidString.into()) } impl Into for LogLevel { -- cgit v1.2.3