~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.


f425055b pyros2097

7 years ago
expose generate assets again
Files changed (3) hide show
  1. Cargo.lock +1 -1
  2. Cargo.toml +1 -1
  3. src/lib.rs +2 -2
Cargo.lock CHANGED
@@ -13,7 +13,7 @@ dependencies = [
13
13
 
14
14
  [[package]]
15
15
  name = "rust-embed"
16
- version = "0.3.5"
16
+ version = "0.4.0"
17
17
  dependencies = [
18
18
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
19
19
  "walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "rust-embed"
3
- version = "0.3.5"
3
+ version = "0.4.0"
4
4
  description = "Rust Marco which loads files into the rust binary at compile time during release and loads the file from the fs during dev"
5
5
  readme = "readme.md"
6
6
  documentation = "https://docs.rs/rust-embed"
src/lib.rs CHANGED
@@ -3,7 +3,7 @@ extern crate log;
3
3
  extern crate walkdir;
4
4
 
5
5
  #[cfg(debug_assertions)]
6
- fn generate_assets(parent_path: String) -> Box<Fn(String) -> Option<Vec<u8>>> {
6
+ pub fn generate_assets(parent_path: String) -> Box<Fn(String) -> Option<Vec<u8>>> {
7
7
  use std::fs::File;
8
8
  use std::path::Path;
9
9
  use std::io::Read;
@@ -32,7 +32,7 @@ fn generate_assets(parent_path: String) -> Box<Fn(String) -> Option<Vec<u8>>> {
32
32
  }
33
33
 
34
34
  #[cfg(not(debug_assertions))]
35
- fn generate_assets<'a>(parent_path: String) -> Box<Fn(String) -> Option<Vec<u8>>> {
35
+ pub fn generate_assets<'a>(parent_path: String) -> Box<Fn(String) -> Option<Vec<u8>>> {
36
36
  use std::fs::File;
37
37
  use std::io::Read;
38
38
  use std::path::Path;