Closed jmcnamara closed 9 months ago
IIUC skip_serializing_if
on one field here basically means to skip serialization of the row containg other fields given a condition.
So the caller can do it directly by iterator filter or continuing in the loop
let slice: &[Produce] = ...;
slice.iter().filter(|p| !skip_check(&p.fruit1)).try_for_each(|p| worksheet.serialize(p));
Oh, I just realized the problem is not that callers can't make it, instead it's if they use skip_serializing_if
, the outcome is incorrect 😢
it's if they use
skip_serializing_if
, the outcome is incorrect 😢
Yes. That is it. I should have written a clearer bug report. ☺️
Current behavior
When using
skip_serializing_if
on a field the output can become unaligned.Expected behavior
Skipping a value should maintain the correct incrementatal row number.
Sample code to reproduce
Note, fixing this may break serialization of array values in a struct. That probably isn't a common use case though.