0.1.2 |
|
---|---|
0.1.1 |
|
0.1.0 |
|
#22 in #include
5KB
56 lines
include-files
Import files bytes into HashMap
Usage
Cargo.toml:
[dependencies]
once_cell = "1.10.0"
[build-dependencies]
include-files = "*"
build.rs:
fn main() {
let target = std::env::var("OUT_DIR").unwrap();
include_files::IncludeFiles::new("./assets", "png", target).build().unwrap();
}
src/example.rs:
// Import build.rs output file
include!(env!("INCLUDE_FILES_PATH"));
for item in INCLUDE_FILES {
println!("{:?}", item);
}
lib.rs
:
Usage
Cargo.toml:
[dependencies]
once_cell = "1.10.0"
[build-dependencies]
include-files = "*"
build.rs:
fn main() {
let target = std::env::var("OUT_DIR").unwrap();
include_files::IncludeFiles::new("./assets", "png", target).build().unwrap();
}
src/example.rs:
// Import build.rs output file
include!(env!("INCLUDE_FILES_PATH"));
for item in INCLUDE_FILES {
println!("{:?}", item);
}