~repos /rust-embed

#rust#proc-macro#http

git clone https://pyrossh.dev/repos/rust-embed.git

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


0b14084a pyros2097

8 years ago
Merge branch 'master' into name-fix
Files changed (1) hide show
  1. src/main.rs +1 -1
src/main.rs CHANGED
@@ -22,7 +22,7 @@ fn recursive_read(pp: &mut Vec<u8>, buffer: &mut Vec<u8>, filepath: &Path) {
22
22
  file.read_to_end(&mut text).unwrap_or_else(|e| {
23
23
  panic!("couldn't read file {}: {}", e, filepath.display());
24
24
  });;
25
- let asset_name = path.file_name().unwrap().to_str().unwrap().replace(".", "_").replace("/", "_").replace("-", "_");
25
+ let asset_name = path.to_str().unwrap().replace(".", "_").replace("/", "_").replace("-", "_");
26
26
  write!(pp, "{}", " \"");
27
27
  write!(pp, "{}", path.display());
28
28
  write!(pp, "{}", "\"");