~repos /rust-embed

#rust#proc-macro#http

git clone https://pyrossh.dev/repos/rust-embed.git
Discussions: https://groups.google.com/g/rust-embed-devs

rust macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.


Files changed (2) hide show
  1. impl/src/lib.rs +1 -1
  2. utils/src/lib.rs +1 -1
impl/src/lib.rs CHANGED
@@ -324,7 +324,7 @@ fn impl_rust_embed(ast: &syn::DeriveInput) -> syn::Result<TokenStream2> {
324
324
 
325
325
  let crate_path: syn::Path = find_attribute_values(ast, "crate_path")
326
326
  .last()
327
- .map(|v| syn::parse_str(&v).unwrap())
327
+ .map(|v| syn::parse_str(v).unwrap())
328
328
  .unwrap_or_else(|| syn::parse_str("rust_embed").unwrap());
329
329
 
330
330
  let mut folder_paths = find_attribute_values(ast, "folder");
utils/src/lib.rs CHANGED
@@ -18,7 +18,7 @@ pub fn get_files(folder_path: String, matcher: PathMatcher) -> impl Iterator<Ite
18
18
  .follow_links(true)
19
19
  .sort_by_file_name()
20
20
  .into_iter()
21
- .filter_map(|e| e.ok())
21
+ .filter_map(std::result::Result::ok)
22
22
  .filter(|e| e.file_type().is_file())
23
23
  .filter_map(move |e| {
24
24
  let rel_path = path_to_str(e.path().strip_prefix(&folder_path).unwrap());