fix(clippy): resolve rust 1.96 lint errors blocking the release gate
cargo clippy --workspace -D warnings fails on three pre-existing spots newly flagged by the current toolchain: unnecessary_sort_by in context_report, question_mark in the provider fallback chain, and unnecessary_map_or in the empty-state widget check. Apply the mechanical fixes clippy suggests; no behavior change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -635,7 +635,7 @@ pub fn format_context_report(report: &PromptSourceMap) -> String {
|
||||
|
||||
pub fn format_context_summary(report: &PromptSourceMap) -> String {
|
||||
let mut entries = report.entries.clone();
|
||||
entries.sort_by(|a, b| b.estimated_tokens.cmp(&a.estimated_tokens));
|
||||
entries.sort_by_key(|entry| std::cmp::Reverse(entry.estimated_tokens));
|
||||
let top = entries
|
||||
.iter()
|
||||
.take(5)
|
||||
|
||||
@@ -5217,9 +5217,7 @@ impl App {
|
||||
|
||||
pub fn advance_fallback(&mut self, reason: impl Into<String>) -> Option<ApiProvider> {
|
||||
let reason = reason.into();
|
||||
let Some(chain) = self.provider_chain.as_mut() else {
|
||||
return None;
|
||||
};
|
||||
let chain = self.provider_chain.as_mut()?;
|
||||
let Some(next_kind) = chain.advance() else {
|
||||
self.last_fallback_reason = Some(format!(
|
||||
"Fallback chain exhausted after {} provider(s): {reason}",
|
||||
|
||||
@@ -2122,7 +2122,7 @@ fn should_render_empty_state(app: &App) -> bool {
|
||||
let active_is_empty = app
|
||||
.active_cell
|
||||
.as_ref()
|
||||
.map_or(true, crate::tui::active_cell::ActiveCell::is_empty);
|
||||
.is_none_or(crate::tui::active_cell::ActiveCell::is_empty);
|
||||
app.history.is_empty()
|
||||
&& active_is_empty
|
||||
&& !app.is_loading
|
||||
|
||||
Reference in New Issue
Block a user