~repos /rust-embed
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.
3e1df30f
—
Hideo Hattori 9 years ago
use file of the same name
- 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.
|
|
24
|
+
let asset_name = path.to_str().unwrap().replace(".", "_").replace("/", "_");
|
|
25
25
|
write!(pp, "{}", " \"");
|
|
26
26
|
write!(pp, "{}", path.display());
|
|
27
27
|
write!(pp, "{}", "\"");
|