Skip to content

Commit

Permalink
refactor: replace map().unwrap_or_else()
Browse files Browse the repository at this point in the history
  • Loading branch information
hamirmahal committed Jan 1, 2025
1 parent 3ae5a2c commit 7ced6cd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,7 @@ fn impl_rust_embed(ast: &syn::DeriveInput) -> syn::Result<TokenStream2> {

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 {
Expand Down

0 comments on commit 7ced6cd

Please sign in to comment.