mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-29 09:37:37 +08:00
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:
@@ -202,6 +202,7 @@ impl CircuitBreaker {
|
||||
}
|
||||
|
||||
/// 获取当前状态
|
||||
#[allow(dead_code)]
|
||||
pub async fn get_state(&self) -> CircuitState {
|
||||
*self.state.read().await
|
||||
}
|
||||
|
||||
@@ -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(¤t_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!(
|
||||
|
||||
Reference in New Issue
Block a user