~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.


4b659678 pyros2097

8 years ago
Merge pull request #2 from hhatto/use-same-file-name
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, "{}", "\"");