(n: usize, bits: u32)
| 39 | } |
| 40 | |
| 41 | fn check_shape(n: usize, bits: u32) -> ArrayResult<()> { |
| 42 | if n > MAX_DIMS { |
| 43 | return Err(ArrayError::InvalidSchema { |
| 44 | array: String::new(), |
| 45 | detail: format!("zorder: arity {n} exceeds MAX_DIMS={MAX_DIMS}"), |
| 46 | }); |
| 47 | } |
| 48 | if bits == 0 || (n as u32) * bits > 64 { |
| 49 | return Err(ArrayError::InvalidSchema { |
| 50 | array: String::new(), |
| 51 | detail: format!("zorder: {n} dims × {bits} bits exceeds 64-bit prefix"), |
| 52 | }); |
| 53 | } |
| 54 | Ok(()) |
| 55 | } |
| 56 | |
| 57 | #[cfg(test)] |
| 58 | mod tests { |