Repository: pyrossh/rust-embed (language: rust)

Issue:
`impl/src/lib.rs` readability improvement
We can get a readability improvement by replacing

```rust
  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());
```

with

```rust
  let crate_path: syn::Path = find_attribute_values(ast, "crate_path")
    .last()
    .map_or_else(|| syn::parse_str("rust_embed").unwrap(), |v| syn::parse_str(v).unwrap());
```


Discussion / hints:

Fix patch:
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<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 {


Test patch: