~repos /rust-embed

#rust#proc-macro#http

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.


21f5f510 Aleti

6 years ago
Fixes based on comments received
Files changed (5) hide show
  1. Cargo.toml +1 -1
  2. impl/src/lib.rs +0 -1
  3. utils/Cargo.toml +1 -1
  4. utils/readme.md +1 -1
  5. utils/src/lib.rs +1 -1
Cargo.toml CHANGED
@@ -21,7 +21,7 @@ warp = { version = "0.1", optional = true }
21
21
  rocket = { version = "0.4.2", optional = true }
22
22
 
23
23
  [features]
24
- debug-embed = ["rust-embed-impl/debug-embed"]
24
+ debug-embed = ["rust-embed-impl/debug-embed", "rust-embed-utils/debug-embed"]
25
25
  interpolate-folder-path = ["rust-embed-impl/interpolate-folder-path"]
26
26
  nightly = ["rocket"]
27
27
  actix = ["actix-web", "mime_guess"]
impl/src/lib.rs CHANGED
@@ -60,7 +60,6 @@ fn generate_assets(ident: &syn::Ident, folder_path: String) -> quote::Tokens {
60
60
  #[cfg(any(not(debug_assertions), feature = "debug-embed"))]
61
61
  fn generate_assets(ident: &syn::Ident, folder_path: String) -> quote::Tokens {
62
62
  extern crate rust_embed_utils;
63
- //use rust_embed_utils::{get_files, FileEntry};
64
63
 
65
64
  let mut match_values = Vec::<Tokens>::new();
66
65
  let mut list_values = Vec::<String>::new();
utils/Cargo.toml CHANGED
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  name = "rust-embed-utils"
3
3
  version = "4.5.0"
4
- description = "Rust Custom Derive Macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev"
4
+ description = "Utilities for rust-embed"
5
5
  readme = "readme.md"
6
6
  documentation = "https://docs.rs/rust-embed"
7
7
  repository = "https://github.com/pyros2097/rust-embed"
utils/readme.md CHANGED
@@ -1,3 +1,3 @@
1
- # Rust Embed Implementation
1
+ # Rust Embed Utilities
2
2
 
3
3
  The utilities used by rust-embed and rust-embed-impl lie here.
utils/src/lib.rs CHANGED
@@ -1,12 +1,12 @@
1
1
  #[cfg(all(debug_assertions, not(feature = "debug-embed")))]
2
2
  extern crate walkdir;
3
+
3
4
  #[cfg_attr(all(debug_assertions, not(feature = "debug-embed")), allow(unused))]
4
5
  pub struct FileEntry {
5
6
  pub rel_path: String,
6
7
  pub full_canonical_path: String,
7
8
  }
8
9
 
9
-
10
10
  #[cfg_attr(all(debug_assertions, not(feature = "debug-embed")), allow(unused))]
11
11
  pub fn get_files(folder_path: String) -> impl Iterator<Item = FileEntry> {
12
12
  walkdir::WalkDir::new(&folder_path)