cargo clippy

This commit is contained in:
2025-11-15 07:54:29 +00:00
parent 01743c3c75
commit 0b68d803e8
6 changed files with 9 additions and 12 deletions

View File

@@ -15,7 +15,9 @@ use crate::action_raw::RawAction;
#[derive(Clone, Copy, Debug, Deserialize_repr)] #[derive(Clone, Copy, Debug, Deserialize_repr)]
#[repr(u8)] #[repr(u8)]
#[derive(Eq, PartialEq)] #[derive(Eq, PartialEq)]
#[derive(Default)]
pub enum ActionType { pub enum ActionType {
#[default]
Unknown = 0, Unknown = 0,
CopyPath = 100, CopyPath = 100,
FileTransfer = 101, FileTransfer = 101,
@@ -32,11 +34,6 @@ pub enum ActionType {
FetchTree = 112, FetchTree = 112,
} }
impl Default for ActionType {
fn default() -> Self {
Self::Unknown
}
}
// --- // ---
// --- BuildStepId // --- BuildStepId

View File

@@ -23,7 +23,7 @@ impl Handler for SubstituteHandler {
) -> color_eyre::Result<bool> { ) -> color_eyre::Result<bool> {
match action { match action {
Action::Start { Action::Start {
start_type: StartFields::Substitute { source, target }, start_type: StartFields::Substitute { .. },
id, id,
.. ..
} => { } => {

View File

@@ -160,7 +160,7 @@ impl Handler for SubstitutionStatusHandler {
) -> color_eyre::Result<bool> { ) -> color_eyre::Result<bool> {
match action { match action {
Action::Start { Action::Start {
start_type: StartFields::CopyPath { path, .. }, start_type: StartFields::CopyPath { .. },
id, id,
.. ..
} => { } => {
@@ -177,24 +177,24 @@ impl Handler for SubstitutionStatusHandler {
} }
Action::Result { Action::Result {
id,
fields: fields:
ResultFields::SetExpected { ResultFields::SetExpected {
action: ActionType::FileTransfer, action: ActionType::FileTransfer,
expected, expected,
}, },
..
} => { } => {
self.max_transfer = *expected; self.max_transfer = *expected;
self.draw_bar(state.term_width); self.draw_bar(state.term_width);
Ok(true) Ok(true)
} }
Action::Result { Action::Result {
id,
fields: fields:
ResultFields::SetExpected { ResultFields::SetExpected {
action: ActionType::CopyPath, action: ActionType::CopyPath,
expected, expected,
}, },
..
} => { } => {
self.max_copy = *expected; self.max_copy = *expected;
self.draw_bar(state.term_width); self.draw_bar(state.term_width);

View File

@@ -16,7 +16,7 @@ impl<'s> BarSegment<'s> {
fn length(&self) -> u64 { fn length(&self) -> u64 {
match self { match self {
BarSegment::Dynamic(c, len) => *len, BarSegment::Dynamic(_c, len) => *len,
BarSegment::Static(c) => c.len() as u64, BarSegment::Static(c) => c.len() as u64,
} }
} }

View File

@@ -16,7 +16,7 @@ pub fn extract_package_name(path: &str) -> Option<Vec<&str>> {
let name_parts: Vec<&str> = parts let name_parts: Vec<&str> = parts
.iter() .iter()
.take_while(|part| !part.chars().next().map_or(false, |c| c.is_ascii_digit())) .take_while(|part| !part.chars().next().is_some_and(|c| c.is_ascii_digit()))
.copied() .copied()
.collect(); .collect();

View File

@@ -1,4 +1,4 @@
use std::{io, marker::PhantomData, rc::Rc}; use std::{io, rc::Rc};
use console::style; use console::style;
use indicatif::{MultiProgress, ProgressBar, ProgressFinish, ProgressStyle}; use indicatif::{MultiProgress, ProgressBar, ProgressFinish, ProgressStyle};