~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. impl/src/lib.rs +1 -2
  2. src/lib.rs +4 -0
impl/src/lib.rs CHANGED
@@ -41,8 +41,7 @@ fn generate_assets(ident: &syn::Ident, folder_path: String) -> quote::Tokens {
41
41
 
42
42
  pub fn iter() -> impl Iterator<Item = std::borrow::Cow<'static, str>> {
43
43
  use std::path::Path;
44
- extern crate rust_embed_utils;
45
- rust_embed_utils::get_files(String::from(#folder_path)).map(|e| std::borrow::Cow::from(e.rel_path))
44
+ rust_embed::utils::get_files(String::from(#folder_path)).map(|e| std::borrow::Cow::from(e.rel_path))
46
45
  }
47
46
  }
48
47
  impl rust_embed::RustEmbed for #ident {
src/lib.rs CHANGED
@@ -6,6 +6,10 @@ extern crate walkdir;
6
6
  extern crate rust_embed_impl;
7
7
  pub use rust_embed_impl::*;
8
8
 
9
+ #[doc(hidden)]
10
+ #[cfg(all(debug_assertions, not(feature = "debug-embed")))]
11
+ pub extern crate rust_embed_utils as utils;
12
+
9
13
  /// A directory of binary assets.
10
14
  ///
11
15
  /// They should be embedded into the executable for release builds,