~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. src/main.rs +1 -1
src/main.rs CHANGED
@@ -21,7 +21,7 @@ fn recursive_read(pp: &mut Vec<u8>, buffer: &mut Vec<u8>, filepath: &Path) {
21
21
  file.read_to_end(&mut text).unwrap_or_else(|e| {
22
22
  panic!("couldn't read file {}: {}", e, filepath.display());
23
23
  });;
24
- let asset_name = path.file_name().unwrap().to_str().unwrap().replace(".", "_").replace("/", "_");
24
+ let asset_name = path.to_str().unwrap().replace(".", "_").replace("/", "_");
25
25
  write!(pp, "{}", " \"");
26
26
  write!(pp, "{}", path.display());
27
27
  write!(pp, "{}", "\"");