~repos /rust-embed

#rust#proc-macro#http

git clone https://pyrossh.dev/repos/rust-embed.git
Discussions: https://groups.google.com/g/rust-embed-devs

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


Files changed (2) hide show
  1. examples/public/images/flower.jpg +0 -0
  2. src/lib.rs +2 -2
examples/public/images/flower.jpg ADDED
Binary file
src/lib.rs CHANGED
@@ -53,7 +53,7 @@ fn generate_assets(ident: &syn::Ident, folder_path: String) -> quote::Tokens {
53
53
  .filter_map(|e| e.ok())
54
54
  .filter(|e| e.file_type().is_file())
55
55
  {
56
- println!(" \x1b[92mCompiling\x1b[0m {}", entry.path().display());
56
+ println!(" \x1b[1m\x1b[92mCompiling\x1b[0m {}", entry.path().display());
57
57
  let base = &folder_path.clone();
58
58
  let key = String::from(entry.path().to_str().expect("Path does not have a string representation")).replace(base, "");
59
59
  let canonical_path = std::fs::canonicalize(entry.path()).expect("Could not get canonical path");
@@ -110,7 +110,7 @@ fn impl_rust_embed(ast: &syn::DeriveInput) -> Tokens {
110
110
  panic!("#[derive(RustEmbed)] attribute value must be a string literal");
111
111
  }
112
112
  };
113
- println!("folder: {}", folder_path);
113
+ println!(" \x1b[1m\x1b[92mCompiling\x1b[0m {}", folder_path);
114
114
  generate_assets(ident, folder_path)
115
115
  }
116
116