style: crank clippy to pedantic+nursery and fix all lints

Enable the full clippy all + pedantic + nursery groups as workspace warnings,
with a small documented allow-list for the pedantic/nursery lints this project
intentionally does not follow (rustdoc-style requirements, deliberate numeric
casts in the protocol/UI layers, and a few noisy nursery lints). Also enable
the rust unused_lifetimes and unsafe_op_in_unsafe_fn lints.

Fixed every resulting warning (527 -> 0) mechanically per clippy's suggestions:
inline format args, const fns, item ordering, let-else, redundant clones,
map_or, cast_lossless, Eq derives, associated-fn conversions for methods that
never used self, and removing unnecessary Result wrappers whose call sites could
never propagate an error. No runtime behavior changed; cargo fmt applied.

cargo clippy --workspace --all-targets: 0 warnings. All tests pass.
This commit is contained in:
michel
2026-07-19 00:09:17 +02:00
parent b149a8ecf2
commit e72c8a5c07
37 changed files with 482 additions and 433 deletions
+6 -8
View File
@@ -71,11 +71,11 @@ pub fn unfocused_border_style() -> Style {
Style::default()
}
pub fn focused_border_type() -> BorderType {
pub const fn focused_border_type() -> BorderType {
BorderType::Rounded
}
pub fn unfocused_border_type() -> BorderType {
pub const fn unfocused_border_type() -> BorderType {
BorderType::Rounded
}
@@ -88,7 +88,7 @@ pub fn border_style(focused: bool) -> Style {
}
}
pub fn border_type(focused: bool) -> BorderType {
pub const fn border_type(focused: bool) -> BorderType {
if focused {
focused_border_type()
} else {
@@ -100,9 +100,7 @@ pub fn border_type(focused: bool) -> BorderType {
pub fn format_shortcuts(shortcuts: &[(&str, &str)]) -> String {
shortcuts
.iter()
.map(|(key, action)| {
format!("[{} {} {}]", key, HIGHLIGHT_SYMBOL, action)
})
.map(|(key, action)| format!("[{key} {HIGHLIGHT_SYMBOL} {action}]"))
.collect::<Vec<_>>()
.join(" ")
}
@@ -124,7 +122,7 @@ pub fn format_shortcuts_styled(shortcuts: &[(&str, &str)]) -> Line<'static> {
.add_modifier(Modifier::BOLD),
));
spans.push(Span::styled(
format!(" {} ", HIGHLIGHT_SYMBOL),
format!(" {HIGHLIGHT_SYMBOL} "),
dimmed_style(),
));
spans.push(Span::raw(action.to_string()));
@@ -165,7 +163,7 @@ pub fn format_progress_bar(
Span::raw("]"),
Span::raw(" "),
Span::styled(
format!("{}%", percentage),
format!("{percentage}%"),
primary_style()
.add_modifier(Modifier::BOLD)
.fg(Color::default()),