diff options
-rw-r--r-- | gifed/src/gif.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/gifed/src/gif.rs b/gifed/src/gif.rs index 1c71d13..90354a1 100644 --- a/gifed/src/gif.rs +++ b/gifed/src/gif.rs @@ -64,16 +64,12 @@ impl<'a> Iterator for ImageIterator<'a> { let starting_block = self.block_index; let img = loop { - match self.gif.blocks.get(self.block_index) { - Some(block) => { - if let Block::CompressedImage(img) = block { - // Step over this image so we don't hit it next time - self.block_index += 1; - - break img; - } - } - None => return None, + let block = self.gif.blocks.get(self.block_index)?; + if let Block::CompressedImage(img) = block { + // Step over this image so we don't hit it next time + self.block_index += 1; + + break img; } self.block_index += 1; |