mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-01-08 12:07:45 +08:00
refactor: optimze path concatenation in get_lang()
This commit is contained in:
parent
78c2a8d0c8
commit
45ee8fbb23
@ -6,9 +6,8 @@ pub async fn get_lang(window: tauri::Window, lang: String) -> String {
|
||||
let lang = lang.to_lowercase();
|
||||
|
||||
// Send contents of language file back
|
||||
let lang_path: PathBuf = [&install_location(), "lang", &format!("{}.json", lang)]
|
||||
.iter()
|
||||
.collect();
|
||||
let lang_path = install_location().join("lang").join(format!("{}.json", lang));
|
||||
|
||||
match std::fs::read_to_string(lang_path) {
|
||||
Ok(x) => x,
|
||||
Err(e) => {
|
||||
|
Loading…
Reference in New Issue
Block a user