~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.
e493f787
—
pyros2097 7 years ago
Closes #27 Again
- src/lib.rs +0 -3
src/lib.rs
CHANGED
|
@@ -23,11 +23,9 @@ fn generate_assets(ident: &syn::Ident, folder_path: String) -> quote::Tokens {
|
|
|
23
23
|
let name = &format!("{}{}", folder_path, file_path);
|
|
24
24
|
let path = &Path::new(name);
|
|
25
25
|
let key = String::from(path.to_str().expect("Path does not have a string representation"));
|
|
26
|
-
println!("file: {}", key);
|
|
27
26
|
let mut file = match File::open(path) {
|
|
28
27
|
Ok(mut file) => file,
|
|
29
28
|
Err(e) => {
|
|
30
|
-
eprintln!("file: {} {}", key, e);
|
|
31
29
|
return None
|
|
32
30
|
}
|
|
33
31
|
};
|
|
@@ -35,7 +33,6 @@ fn generate_assets(ident: &syn::Ident, folder_path: String) -> quote::Tokens {
|
|
|
35
33
|
match file.read_to_end(&mut data) {
|
|
36
34
|
Ok(_) => Some(data),
|
|
37
35
|
Err(e) => {
|
|
38
|
-
eprintln!("file: {} {}", key, e);
|
|
39
36
|
return None
|
|
40
37
|
}
|
|
41
38
|
}
|