mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-24 10:46:50 -06:00
Fix two clippy lints new in Rust 1.95
CI installs the stable toolchain, and Rust 1.95's clippy fails 'cargo clippy --workspace --all-targets -- -D warnings' on main: - xls/mod.rs: collapsible_match. The XF record's size check becomes a match guard; a full table still ignores the record (the catch-all arm). - passthrough_tests.rs: nonminimal_bool. !is_some_and(x) is written as is_none_or(!x). No change in behaviour. Signed-off-by: MH <q6rrzz@gmail.com>
This commit is contained in:
@@ -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::<usize>();
|
||||
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();
|
||||
|
||||
@@ -269,11 +269,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 => {
|
||||
|
||||
Reference in New Issue
Block a user