~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 (1) hide show
  1. utils/src/lib.rs +1 -1
utils/src/lib.rs CHANGED
@@ -22,7 +22,7 @@ pub fn get_files(folder_path: String, matcher: PathMatcher) -> impl Iterator<Ite
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());
25
- let full_canonical_path = path_to_str(std::fs::canonicalize(e.path()).expect("Could not get canonical path"));
25
+ let full_canonical_path = path_to_str(std::fs::canonicalize(e.path()).ok()?);
26
26
 
27
27
  let rel_path = if std::path::MAIN_SEPARATOR == '\\' {
28
28
  rel_path.replace('\\', "/")