fix: resolve clippy warnings

This commit is contained in:
objz committed 2026-02-07 17:08:47 +01:00
1 parent 0ec95e51e4
commit 4f597d04b2
12 files changed
+48 -42

No files matched your search

+3 -1
View File
@@ -8,13 +8,15 @@ use ratatui::{
use crate::tui::theme::THEME;
type ContentFn<'a> = Box<dyn Fn(Rect, &mut Buffer) + 'a>;
pub struct PopupFrame<'a> {
pub title: Line<'a>,
pub border_color: Color,
pub bg: Option<Color>,
pub keybinds: Option<Line<'a>>,
pub search_line: Option<Line<'a>>,
pub content: Box<dyn Fn(Rect, &mut Buffer) + 'a>,
pub content: ContentFn<'a>,
}
impl<'a> Widget for PopupFrame<'a> {
+4 -7
View File
@@ -42,18 +42,15 @@ pub enum WizardStep {
}
#[derive(Debug, Clone)]
#[derive(Default)]
pub enum LoadState<T> {
#[default]
Idle,
Loading,
Loaded(T),
Error(String),
}
impl<T> Default for LoadState<T> {
fn default() -> Self {
LoadState::Idle
}
}
#[derive(Debug, Clone)]
pub struct WizardState {
@@ -255,7 +252,7 @@ fn handle_name_key(
state.step = WizardStep::Loader;
}
_ => {
state.name_state.handle_key_event(key_event.clone());
state.name_state.handle_key_event(*key_event);
}
}
}
@@ -785,7 +782,7 @@ fn compare_semver(a: &str, b: &str) -> std::cmp::Ordering {
a_parts.len().cmp(&b_parts.len())
}
fn sort_versions_semver(versions: &mut Vec<GameVersion>) {
fn sort_versions_semver(versions: &mut [GameVersion]) {
// Sort newest first (descending), so compare b vs a
versions.sort_by(|a, b| compare_semver(&b.id, &a.id));
}