FIX: Minor issues

This commit is contained in:
Nicolás Hatcher
2024-02-13 17:03:10 +01:00
parent 0519c38637
commit d58d3b2275
2 changed files with 2 additions and 6 deletions

View File

@@ -112,7 +112,7 @@ pub(crate) fn load_table<R: Read + std::io::Seek>(
.filter(|n| n.has_tag_name("autoFilter")) .filter(|n| n.has_tag_name("autoFilter"))
.collect::<Vec<Node>>(); .collect::<Vec<Node>>();
let has_filters = if let Some(filter) = auto_filter.get(0) { let has_filters = if let Some(filter) = auto_filter.first() {
filter.children().count() > 0 filter.children().count() > 0
} else { } else {
false false
@@ -179,7 +179,7 @@ pub(crate) fn load_table<R: Read + std::io::Seek>(
.descendants() .descendants()
.filter(|n| n.has_tag_name("tableInfo")) .filter(|n| n.has_tag_name("tableInfo"))
.collect::<Vec<Node>>(); .collect::<Vec<Node>>();
let style_info = match table_info.get(0) { let style_info = match table_info.first() {
Some(node) => { Some(node) => {
let name = node.attribute("name").map(|s| s.to_string()); let name = node.attribute("name").map(|s| s.to_string());
TableStyleInfo { TableStyleInfo {

View File

@@ -10,7 +10,6 @@ use ironcalc_base::{
types::{Cell, Col, Comment, DefinedName, Row, SheetData, SheetState, Table, Worksheet}, types::{Cell, Col, Comment, DefinedName, Row, SheetData, SheetState, Table, Worksheet},
}; };
use roxmltree::Node; use roxmltree::Node;
use serde::{Deserialize, Serialize};
use thiserror::Error; use thiserror::Error;
use crate::error::XlsxError; use crate::error::XlsxError;
@@ -20,7 +19,6 @@ use super::{
util::{get_attribute, get_color, get_number}, util::{get_attribute, get_color, get_number},
}; };
#[derive(Serialize, Deserialize)]
pub(crate) struct Sheet { pub(crate) struct Sheet {
pub(crate) name: String, pub(crate) name: String,
pub(crate) sheet_id: u32, pub(crate) sheet_id: u32,
@@ -28,13 +26,11 @@ pub(crate) struct Sheet {
pub(crate) state: SheetState, pub(crate) state: SheetState,
} }
#[derive(Serialize, Deserialize)]
pub(crate) struct WorkbookXML { pub(crate) struct WorkbookXML {
pub(crate) worksheets: Vec<Sheet>, pub(crate) worksheets: Vec<Sheet>,
pub(crate) defined_names: Vec<DefinedName>, pub(crate) defined_names: Vec<DefinedName>,
} }
#[derive(Serialize, Deserialize)]
pub(crate) struct Relationship { pub(crate) struct Relationship {
pub(crate) target: String, pub(crate) target: String,
pub(crate) rel_type: String, pub(crate) rel_type: String,