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