This is important because most of the arithmetic in that module goes to calculating values for various length/offset fields in the transfer format, and if one of those calculations overflows we want to signal an error rather than serialize a broken document.
I've eliminated unchecked integer arithmetic from
sndjvu_format::ser
, except for a few innocuous uses: https://github.com/sndjvu/workspace/blob/eecf635735e64acb439e1da28954596a1a1ea30d/crates/sndjvu_format/src/ser.rs#L7This is important because most of the arithmetic in that module goes to calculating values for various length/offset fields in the transfer format, and if one of those calculations overflows we want to signal an error rather than serialize a broken document.