Fix clippy collapsible_match in colibri-tui session nav (Sam & Claude)

The Tab / BackTab key arms wrapped their whole body in
`if !app.sessions.is_empty()`. clippy (-D warnings) flagged both as
collapsible_match; lift the guard onto the match arm. Empty `sessions` now
falls through to the catch-all — same no-op as before, behavior unchanged.

Gates on c2655d1 + this: build ok, cargo test --workspace 65 passed/0 failed,
cargo clippy --workspace --all-targets -- -D warnings clean, cargo fmt --check clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Sam & Claude 2026-05-27 15:15:15 +02:00
parent c2655d1d41
commit 5d45a0f74b

View file

@ -529,35 +529,31 @@ async fn run(socket_path: PathBuf) -> io::Result<()> {
}
}
}
KeyCode::Tab | KeyCode::Char('\t') => {
if !app.sessions.is_empty() {
app.session_idx = (app.session_idx + 1) % app.sessions.len();
app.session_filter = app.sessions.get(app.session_idx).cloned();
app.table_state.select(Some(0));
app.detail_pane = None;
app.set_status(format!(
"session {}/{}",
app.session_idx + 1,
app.sessions.len()
));
}
KeyCode::Tab | KeyCode::Char('\t') if !app.sessions.is_empty() => {
app.session_idx = (app.session_idx + 1) % app.sessions.len();
app.session_filter = app.sessions.get(app.session_idx).cloned();
app.table_state.select(Some(0));
app.detail_pane = None;
app.set_status(format!(
"session {}/{}",
app.session_idx + 1,
app.sessions.len()
));
}
KeyCode::BackTab => {
if !app.sessions.is_empty() {
app.session_idx = if app.session_idx == 0 {
app.sessions.len() - 1
} else {
app.session_idx - 1
};
app.session_filter = app.sessions.get(app.session_idx).cloned();
app.table_state.select(Some(0));
app.detail_pane = None;
app.set_status(format!(
"session {}/{}",
app.session_idx + 1,
app.sessions.len()
));
}
KeyCode::BackTab if !app.sessions.is_empty() => {
app.session_idx = if app.session_idx == 0 {
app.sessions.len() - 1
} else {
app.session_idx - 1
};
app.session_filter = app.sessions.get(app.session_idx).cloned();
app.table_state.select(Some(0));
app.detail_pane = None;
app.set_status(format!(
"session {}/{}",
app.session_idx + 1,
app.sessions.len()
));
}
KeyCode::Down | KeyCode::Char('j') => {
let count = app.filtered_panes().len();