FIX: Forbid unwrap, expect and panic in the base code

This commit is contained in:
Nicolás Hatcher
2024-11-16 14:18:12 +01:00
committed by Nicolás Hatcher Andrés
parent bdd2c8fe04
commit 49ae2d8915
43 changed files with 341 additions and 128 deletions

View File

@@ -1,3 +1,5 @@
#![allow(clippy::unwrap_used)]
use std::{collections::HashMap, io::Read, num::ParseIntError};
use ironcalc_base::{
@@ -1037,7 +1039,10 @@ pub(super) fn load_sheets<R: Read + std::io::Seek>(
name: sheet_name.to_string(),
id: sheet.sheet_id,
state: state.clone(),
comments: comments.get(rel_id).expect("").to_vec(),
comments: comments
.get(rel_id)
.ok_or_else(|| XlsxError::Xml("Corrupt XML structure".to_string()))?
.to_vec(),
};
let (s, is_selected) =
load_sheet(archive, &path, settings, worksheets, tables, shared_strings)?;