simplify text.json loading code
This commit is contained in:
parent
e453ec8da4
commit
04201de443
@ -108,17 +108,8 @@ lazy_static::lazy_static! {
|
|||||||
panic!("Font File {} not expected!", path_string);
|
panic!("Font File {} not expected!", path_string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if path_string.ends_with(".json") {
|
} else if path_string == "text.json" {
|
||||||
// Parse json file
|
text_data = Some(SerdeValueHelper::new(str::from_utf8(&data).expect("unable to read text.json")).parse_values());
|
||||||
let string_data = str::from_utf8(&data).unwrap().to_string();
|
|
||||||
match path_string.as_ref() {
|
|
||||||
"text.json" => {
|
|
||||||
text_data = Some(SerdeValueHelper::new(&string_data).parse_values());
|
|
||||||
},
|
|
||||||
_ => {
|
|
||||||
panic!("Json file {} not expected!", path_string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
panic!("Other file {} not expected!", path_string);
|
panic!("Other file {} not expected!", path_string);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user