diff --git a/crates/xlsx/src/tests/passthrough_tests.rs b/crates/xlsx/src/tests/passthrough_tests.rs index d844daa05..eff83703e 100644 --- a/crates/xlsx/src/tests/passthrough_tests.rs +++ b/crates/xlsx/src/tests/passthrough_tests.rs @@ -477,7 +477,7 @@ fn kept_vml_drawings_are_charged_to_the_kept_total() { + wb.sheets.iter().filter_map(|s| s.preserved.as_ref()).map(|p| p.byte_len()).sum::(); assert!(kept <= one + VML.len() / 2, "kept {kept} bytes"); assert!(wb.sheet(0).unwrap().preserved.as_ref().is_some_and(|p| p.vml.is_some())); - assert!(!wb.sheet(1).unwrap().preserved.as_ref().is_some_and(|p| p.vml.is_some())); + assert!(wb.sheet(1).unwrap().preserved.as_ref().is_none_or(|p| p.vml.is_none())); assert!(rep.warnings.iter().any(|w| w.contains("\"Other\"") && w.contains("too large")), "{:?}", rep.warnings); // Both sheets keep their drawings when there is room. let (wb, _) = read_xlsx(&rich_package_with(CONTENT_TYPES, true)).unwrap(); diff --git a/crates/xlsx/src/xls/mod.rs b/crates/xlsx/src/xls/mod.rs index 7a5e6e4b3..a24051338 100644 --- a/crates/xlsx/src/xls/mod.rs +++ b/crates/xlsx/src/xls/mod.rs @@ -272,11 +272,9 @@ fn globals(stream: &[u8], budget: &mut Budget, report: &mut ReadReport) -> Resul budget.text(code.len())?; g.formats.insert(ifmt, code); } - 0x00E0 => { - if g.xf_formats.len() < MAX_XFS { - c.u16()?; - g.xf_formats.push(c.u16()?); - } + 0x00E0 if g.xf_formats.len() < MAX_XFS => { + c.u16()?; + g.xf_formats.push(c.u16()?); } 0x00FC => g.sst = shared_strings(&mut c, budget)?, 0x01AE => {