Dispatch sparse tile decoding by peeking the tag byte. - Recognized tag (0 or 1): delegate to `decode_sparse_tile`. - Empty payload or unrecognized byte: return a corruption error.
(payload: &[u8])
| 106 | /// - Recognized tag (0 or 1): delegate to `decode_sparse_tile`. |
| 107 | /// - Empty payload or unrecognized byte: return a corruption error. |
| 108 | fn read_sparse_tile(payload: &[u8]) -> ArrayResult<SparseTile> { |
| 109 | match peek_tag(payload) { |
| 110 | Some(_) => decode_sparse_tile(payload), |
| 111 | None => Err(ArrayError::SegmentCorruption { |
| 112 | detail: format!( |
| 113 | "sparse tile has unrecognized tag byte {:#04x}", |
| 114 | payload.first().copied().unwrap_or(0) |
| 115 | ), |
| 116 | }), |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | /// Decoded tile payload. |
| 121 | #[derive(Debug, Clone, PartialEq)] |
no test coverage detected