From 7ced6cd27ed8b4ddfc6eb83932aa90c05d9dad17 Mon Sep 17 00:00:00 2001 From: Hamir Mahal Date: Wed, 1 Jan 2025 11:38:06 -0800 Subject: [PATCH] refactor: replace `map().unwrap_or_else()` --- impl/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/impl/src/lib.rs b/impl/src/lib.rs index 0399daa..2470c74 100644 --- a/impl/src/lib.rs +++ b/impl/src/lib.rs @@ -324,8 +324,7 @@ fn impl_rust_embed(ast: &syn::DeriveInput) -> syn::Result { let crate_path: syn::Path = find_attribute_values(ast, "crate_path") .last() - .map(|v| syn::parse_str(v).unwrap()) - .unwrap_or_else(|| syn::parse_str("rust_embed").unwrap()); + .map_or_else(|| syn::parse_str("rust_embed").unwrap(), |v| syn::parse_str(v).unwrap()); let mut folder_paths = find_attribute_values(ast, "folder"); if folder_paths.len() != 1 {