Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Apr 24, 2024
1 parent c8636a0 commit e5bcd63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/encoderust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl<W: Write> RustEncoder<W> {
// 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 {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down

0 comments on commit e5bcd63

Please sign in to comment.