Simple way to use include_bytes!
for directories.
Example
use embed_dir::Embed;
#[derive(Embed)]
#[dir = "../web/static"] // Path is relativ to the current file
pub struct Assets;
fn main(){
let file: &[u8] = Assets::get("css/style.css").expect("Can't find file");
let string = str::from_utf8(file).expect("Failed to parse file");
println!("{string}");
}
Description
Languages
Rust
100%