style(format): iterate the dimensions when checking them against their maxima

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
osobh
2026-09-26 10:28:10 -05:00
co-authored by Claude Opus 5.5
parent b22b15f00a
commit d3d73676c0
+2 -2
View File
@@ -121,9 +121,9 @@ impl Dataspace {
// Read max dimensions if flags bit 0 is set
let max_dimensions = if flags & 0x01 != 0 {
let mut max_dims = Vec::with_capacity(rank as usize);
for i in 0..rank as usize {
for &dim in &dimensions {
let val = read_length(data, pos, length_size)?;
if dimensions[i] > val {
if dim > val {
return Err(FormatError::InvalidDataspace(
"dataspace dimension size is greater than its maximum size",
));