fighting_daisy 0.1.0

Library for fighting daisies
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use include_directory::{Dir, File, include_directory};
use std::path::Path;

static PROJECT_DIR: Dir<'_> = include_directory!("assets");

pub fn read_any_file(name: &str) -> File {
    let path = Path::new(name);
    let file = PROJECT_DIR
        .get_file(path)
        .unwrap_or_else(|| panic!("could not find file this name: {}", path.to_str().unwrap()));
    file.clone()
}