Skip to content

Commit 2e69081

Browse files
authored
Merge pull request #255 from hamirmahal/refactor/replace-map-unwrap-or-else
refactor: replace `map().unwrap_or_else()`
2 parents 6ef52c6 + 7ced6cd commit 2e69081

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

impl/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,7 @@ fn impl_rust_embed(ast: &syn::DeriveInput) -> syn::Result<TokenStream2> {
324324

325325
let crate_path: syn::Path = find_attribute_values(ast, "crate_path")
326326
.last()
327-
.map(|v| syn::parse_str(v).unwrap())
328-
.unwrap_or_else(|| syn::parse_str("rust_embed").unwrap());
327+
.map_or_else(|| syn::parse_str("rust_embed").unwrap(), |v| syn::parse_str(v).unwrap());
329328

330329
let mut folder_paths = find_attribute_values(ast, "folder");
331330
if folder_paths.len() != 1 {

0 commit comments

Comments
 (0)