tafia / calamine

A pure Rust Excel/OpenDocument SpreadSheets file reader: rust on metal sheets
MIT License
1.6k stars 155 forks source link

Use `chunks` instead of `chunks_exact` #379

Closed jqnatividad closed 6 months ago

jqnatividad commented 7 months ago

The chunks_exact method returns chunks of exactly 4 bytes, and any leftover bytes at the end of the slice are ignored.

Since we know that the input slice will always be a multiple of 4 bytes per the assert, we can use the chunks method instead, which is slightly faster because it doesn't need to redundantly check for leftover bytes.

tafia commented 6 months ago

Thanks!