mirror of
https://github.com/mat-1/azalea.git
synced 2024-09-19 22:52:32 +00:00
fix saving being slow
This commit is contained in:
parent
d9795a593a
commit
a3e26b38bd
1 changed files with 8 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
use lazy_static::lazy_static;
|
||||
use std::collections::HashMap;
|
||||
use std::{collections::HashMap, fs::File};
|
||||
|
||||
// use tokio::fs::File;
|
||||
|
||||
|
@ -29,8 +29,13 @@ use std::collections::HashMap;
|
|||
// The code above is kept in case I come up with a better solution
|
||||
|
||||
lazy_static! {
|
||||
pub static ref STORAGE: HashMap<String, String> =
|
||||
serde_json::from_str(include_str!("en_us.json")).unwrap();
|
||||
pub static ref STORAGE: HashMap<String, String> = serde_json::from_str({
|
||||
let mut file = File::open("en_us.json").unwrap();
|
||||
let mut contents = String::new();
|
||||
file.read_to_string(&mut contents).unwrap();
|
||||
contents
|
||||
})
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
pub fn get(key: &str) -> Option<&str> {
|
||||
|
|
Loading…
Reference in a new issue