From bcfe99578b67f08e324cfc2c621a7e99a9104720 Mon Sep 17 00:00:00 2001 From: gwenn Date: Wed, 5 Jan 2022 19:37:10 +0100 Subject: [PATCH] clippy::map_unwrap_or --- src/hooks.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hooks.rs b/src/hooks.rs index da8e95a..d8dbb76 100644 --- a/src/hooks.rs +++ b/src/hooks.rs @@ -629,8 +629,7 @@ impl InnerConnection { let boxed_hook: *mut F = p_arg as *mut F; (*boxed_hook)(auth_ctx) }) - .map(Authorization::into_raw) - .unwrap_or_else(|_| ffi::SQLITE_ERROR) + .map_or_else(|_| ffi::SQLITE_ERROR, Authorization::into_raw) } let callback_fn = authorizer @@ -644,8 +643,7 @@ impl InnerConnection { callback_fn, boxed_authorizer .as_ref() - .map(|f| &**f as *const F as *mut _) - .unwrap_or_else(ptr::null_mut), + .map_or_else(ptr::null_mut, |f| &**f as *const F as *mut _), ) } { ffi::SQLITE_OK => {