Skip to content

Commit

Permalink
wip: address clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
superyu1337 committed Dec 1, 2024
1 parent 8fe7e92 commit fad969c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct Cli {
}

#[derive(Subcommand, Debug)]
#[allow(clippy::large_enum_variant)]
enum Commands {
/// Compare two still images. Resolutions must be identical.
Image {
Expand Down
12 changes: 4 additions & 8 deletions src/video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ fn pretty_spinner_style() -> ProgressStyle {
.progress_chars(PROGRESS_CHARS)
}

type VideoCompareMutex<E, F> = Mutex<((usize, usize), (E, F))>;

fn calc_score<S: Pixel, D: Pixel, E: Decoder, F: Decoder>(
mtx: &Mutex<((usize, usize), (E, F))>,
mtx: &VideoCompareMutex<E, F>,
src_yuvcfg: &YuvConfig,
dst_yuvcfg: &YuvConfig,
inc: usize,
Expand Down Expand Up @@ -404,13 +406,7 @@ fn compare_videos_inner<D: Decoder + 'static, E: Decoder + 'static>(

let current_frame = 0usize;
let start_frame = start_frame.unwrap_or(0);
let end_frame = {
if let Some(frames_to_compare) = frames_to_compare {
Some(start_frame + (frames_to_compare * inc))
} else {
None
}
};
let end_frame = frames_to_compare.map(|frames_to_compare| start_frame + (frames_to_compare * inc));

let decoders = Arc::new(Mutex::new(((start_frame, current_frame), (source, distorted))));

Expand Down

0 comments on commit fad969c

Please sign in to comment.