include champions in binary

This commit is contained in:
soruh 2023-11-29 23:10:16 +01:00
parent 66c0ea1aa3
commit ea928cb5c3

View File

@ -205,8 +205,8 @@ fn _dispatch_error_no_macro<'fut>(
async fn main() {
let _ = dotenv::from_filename(".env");
let champions = std::fs::File::open("champions.json").expect("failed to open champions.json");
let champions: Vec<Champion> = serde_json::from_reader::<_, HashMap<String, String>>(champions)
let champions: Vec<Champion> =
serde_json::from_str::<HashMap<String, String>>(include_str!("../champions.json"))
.expect("failed to parse champions")
.into_iter()
.map(|(name, url)| Champion { name, url })