diff --git a/Cargo.toml b/Cargo.toml index ab947f5..040cebe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ anyhow = { workspace = true } thiserror = { workspace = true } log = { workspace = true } env_logger = { workspace = true } -chrono = { workspace = true, features = ["serde"] } +chrono = { workspace = true, features = ["serde", "clock"] } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } uuid = { workspace = true, features = ["serde", "v4"] } @@ -35,7 +35,7 @@ tokio = { workspace = true, features = ["sync", "time"] } diesel = { workspace = true, features = ["postgres", "uuid", "chrono", "serde_json", "r2d2"], optional = true } # Optional: HTTP Client -reqwest = { workspace = true, features = ["json"], optional = true } +reqwest = { workspace = true, features = ["json", "rustls-tls"], optional = true } # Optional: Validation validator = { workspace = true, optional = true } diff --git a/src/i18n/bundle.rs b/src/i18n/bundle.rs index 66d7dcf..d885b27 100644 --- a/src/i18n/bundle.rs +++ b/src/i18n/bundle.rs @@ -98,7 +98,7 @@ impl LocaleBundle { let path = entry.path(); - if path.extension().map_or(false, |ext| ext == "ftl") { + if path.extension().is_some_and(|ext| ext == "ftl") { let content = fs::read_to_string(&path).map_err(|e| { BotError::config(format!( "failed to read translation file {}: {e}", diff --git a/src/i18n/locale.rs b/src/i18n/locale.rs index 06f4012..a08f285 100644 --- a/src/i18n/locale.rs +++ b/src/i18n/locale.rs @@ -72,10 +72,8 @@ impl Locale { ) -> &'a Locale { for req in requested { for avail in available { - if req.language == avail.language { - if req.region == avail.region { - return avail; - } + if req.language == avail.language && req.region == avail.region { + return avail; } } }