From 82f816ddcd9f9aa5c29fcda600913faaa5f434f6 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Thu, 19 Feb 2026 11:48:18 +0000 Subject: [PATCH] fix: Resolve unused import and variable warnings --- src/http_client.rs | 4 ++-- src/i18n/bundle.rs | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/http_client.rs b/src/http_client.rs index 7a9c823..0b6243a 100644 --- a/src/http_client.rs +++ b/src/http_client.rs @@ -217,8 +217,8 @@ mod tests { #[test] fn test_client_creation() { - let client = BotServerClient::new(Some("http://localhost:8080".to_string())); - assert_eq!(client.base_url(), "http://localhost:8080"); + let client = BotServerClient::new(Some("http://localhost:9000".to_string())); + assert_eq!(client.base_url(), "http://localhost:9000"); } #[test] diff --git a/src/i18n/bundle.rs b/src/i18n/bundle.rs index bdcda6f..8a6c3aa 100644 --- a/src/i18n/bundle.rs +++ b/src/i18n/bundle.rs @@ -1,6 +1,8 @@ use crate::error::{BotError, BotResult}; use std::collections::HashMap; +#[cfg(not(feature = "i18n"))] use std::fs; +#[cfg(not(feature = "i18n"))] use std::path::Path; #[cfg(feature = "i18n")] @@ -89,6 +91,7 @@ struct LocaleBundle { } impl LocaleBundle { + #[cfg(not(feature = "i18n"))] fn load(locale_dir: &Path) -> BotResult { let dir_name = locale_dir .file_name() @@ -172,7 +175,7 @@ pub struct I18nBundle { } impl I18nBundle { - pub fn load(base_path: &str) -> BotResult { + pub fn load(_base_path: &str) -> BotResult { // When i18n feature is enabled, locales are ALWAYS embedded via rust-embed // Filesystem loading is deprecated - use embedded assets only #[cfg(feature = "i18n")] @@ -183,13 +186,13 @@ impl I18nBundle { #[cfg(not(feature = "i18n"))] { - let _base_path = base_path; // Suppress unused warning when i18n is enabled + // let _base_path = base_path; // Suppress unused warning when i18n is enabled - let base = Path::new(base_path); + let base = Path::new(_base_path); if !base.exists() { return Err(BotError::config(format!( - "locales directory not found: {base_path}" + "locales directory not found: {_base_path}" ))); }