Skip to content

Commit 6b7a632

Browse files
committed
Fix clippy lints
1 parent bc7bd27 commit 6b7a632

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

gift-bin/src/main.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// main.rs gift command
22
//
3-
// Copyright (c) 2019-2025 Douglas Lau
3+
// Copyright (c) 2019-2026 Douglas Lau
44
//
55
#![forbid(unsafe_code)]
66

@@ -127,14 +127,14 @@ fn show_file(
127127
writeln!(out, "{:?}", path)?;
128128
out.set_color(&bold)?;
129129
write!(out, "GIF{}, frames: {}", gif, frames.len())?;
130-
if let Some(ap) = preamble.loop_count_ext {
131-
if let Some(c) = ap.loop_count() {
132-
write!(out, ", repeat: ")?;
133-
if c == 0 {
134-
write!(out, "∞")?;
135-
} else {
136-
write!(out, "{}", c)?;
137-
}
130+
if let Some(ap) = preamble.loop_count_ext
131+
&& let Some(c) = ap.loop_count()
132+
{
133+
write!(out, ", repeat: ")?;
134+
if c == 0 {
135+
write!(out, "∞")?;
136+
} else {
137+
write!(out, "{}", c)?;
138138
}
139139
}
140140
if !comments.is_empty() {

gift/src/decode.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// decode.rs
22
//
3-
// Copyright (c) 2019-2025 Douglas Lau
3+
// Copyright (c) 2019-2026 Douglas Lau
44
//
55
//! GIF file decoding
66
use crate::block::*;
@@ -225,10 +225,10 @@ impl<R: Read> Blocks<R> {
225225
.with_height(height)
226226
.with_flags(flags);
227227
self.image_sz = b.image_sz();
228-
if let Some(sz) = self.max_image_sz {
229-
if self.image_sz > sz {
230-
return Err(Error::TooLargeImage);
231-
}
228+
if let Some(sz) = self.max_image_sz
229+
&& self.image_sz > sz
230+
{
231+
return Err(Error::TooLargeImage);
232232
}
233233
Ok(b.into())
234234
}
@@ -630,10 +630,10 @@ impl<R: Read> Iterator for StepsOnce<R> {
630630
type Item = Result<Step>;
631631

632632
fn next(&mut self) -> Option<Self::Item> {
633-
if self.raster.is_none() {
634-
if let Err(e) = self.make_raster() {
635-
return Some(Err(e));
636-
}
633+
if self.raster.is_none()
634+
&& let Err(e) = self.make_raster()
635+
{
636+
return Some(Err(e));
637637
}
638638
match self.raster {
639639
Some(_) => self.next_step(),

0 commit comments

Comments
 (0)