style: fix clippy warnings and typescript errors

- Add allow(dead_code) for CircuitBreaker::get_state (reserved for future)
- Fix all uninlined format string warnings (27 instances)
- Use inline format syntax for better readability
- Fix unused import and parameter warnings in ProviderActions.tsx
- Achieve zero warnings in both Rust and TypeScript
This commit is contained in:
YoVinchen
2025-12-14 16:05:38 +08:00
parent 4cf4654863
commit 2af8dd2dac
4 changed files with 19 additions and 29 deletions
+1
View File
@@ -202,6 +202,7 @@ impl CircuitBreaker {
}
/// 获取当前状态
#[allow(dead_code)]
pub async fn get_state(&self) -> CircuitState {
*self.state.read().await
}
+2 -2
View File
@@ -34,12 +34,12 @@ impl ProviderRouter {
let current_id = self
.db
.get_current_provider(app_type)?
.ok_or_else(|| AppError::Config(format!("No current provider for {}", app_type)))?;
.ok_or_else(|| AppError::Config(format!("No current provider for {app_type}")))?;
let providers = self.db.get_all_providers(app_type)?;
let provider = providers
.get(&current_id)
.ok_or_else(|| AppError::Config(format!("Current provider {} not found", current_id)))?
.ok_or_else(|| AppError::Config(format!("Current provider {current_id} not found")))?
.clone();
log::info!(