From e5bcd63658a1955bcc3a7c5e8cf61c55dbebc230 Mon Sep 17 00:00:00 2001 From: Kornel Date: Wed, 24 Apr 2024 01:42:55 +0100 Subject: [PATCH] Clippy --- src/encoderust.rs | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/encoderust.rs b/src/encoderust.rs index 88468bc..b151503 100644 --- a/src/encoderust.rs +++ b/src/encoderust.rs @@ -59,7 +59,7 @@ impl RustEncoder { // Palette should be power-of-two sized if pal.len() != 256 { let needed_size = 3 * pal.len().max(2).next_power_of_two(); - pal_rgb.extend(repeat([115,107,105,46,103,105,102]).flat_map(|x| x).take(needed_size - pal_rgb.len())); + pal_rgb.extend(repeat([115,107,105,46,103,105,102]).flatten().take(needed_size - pal_rgb.len())); debug_assert_eq!(needed_size, pal_rgb.len()); } let mut frame = gif::Frame { diff --git a/src/lib.rs b/src/lib.rs index 5feadca..40033ed 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -521,7 +521,7 @@ impl Writer { // delay=1 doesn't work, and it's too late to drop frames now let delay = ((end_pts * 100_f64).round() as u64) .saturating_sub(pts_in_delay_units) - .min(30000).max(2) as u16; + .clamp(2, 30000) as u16; pts_in_delay_units += u64::from(delay); enc.write_frame(frame, delay, screen_width, screen_height, &self.settings.s)?;