~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.
18af2a48
—
Peter 6 years ago
Merge pull request #75 from pyros2097/fix/util-debug-import-error
- impl/src/lib.rs +1 -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
|
-
|
|
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,
|