Skip to content

Commit eae5336

Browse files
committed
Add comment regarding avoiding panics
1 parent a3590df commit eae5336

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/png/scan_lines.rs

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ impl<'a> Iterator for ScanLines<'a> {
2727
let (len, pass, num_pixels) = self.iter.next()?;
2828
debug_assert!(self.raw_data.len() >= len);
2929
debug_assert!(!self.has_filter || len > 1);
30+
// The data length should always be correct here but this check assures
31+
// the compiler that it doesn't need to account for a potential panic
3032
if self.raw_data.len() < len {
3133
return None;
3234
}

0 commit comments

Comments
 (0)