style: slightly changed GameEdition::default method code style

This commit is contained in:
Observer KRypt0n_ 2023-03-08 14:31:16 +02:00
parent 2ff3ad0122
commit d64d15cf27
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2

View file

@ -33,11 +33,10 @@ pub enum GameEdition {
impl Default for GameEdition {
fn default() -> Self {
#[allow(clippy::or_fun_call)]
let locale = std::env::var("LC_ALL").unwrap_or_else(|_| {
std::env::var("LC_MESSAGES").unwrap_or_else(|_| {
std::env::var("LANG").unwrap_or(String::from("en_us"))
})
});
let locale = std::env::var("LC_ALL")
.unwrap_or_else(|_| std::env::var("LC_MESSAGES")
.unwrap_or_else(|_| std::env::var("LANG")
.unwrap_or(String::from("en_us"))));
if locale.len() > 4 && &locale[..5].to_ascii_lowercase() == "zh_cn" {
Self::China