From ea928cb5c39524f91070d13a03294694f693c40b Mon Sep 17 00:00:00 2001 From: soruh Date: Wed, 29 Nov 2023 23:10:16 +0100 Subject: [PATCH] include champions in binary --- src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6770d69..daa74df 100644 --- a/src/main.rs +++ b/src/main.rs @@ -205,12 +205,12 @@ 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 = serde_json::from_reader::<_, HashMap>(champions) - .expect("failed to parse champions") - .into_iter() - .map(|(name, url)| Champion { name, url }) - .collect(); + let champions: Vec = + serde_json::from_str::>(include_str!("../champions.json")) + .expect("failed to parse champions") + .into_iter() + .map(|(name, url)| Champion { name, url }) + .collect(); // Configure the client with your Discord bot token in the environment. let token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");