From c0c6c69975d9ca8aeb90d3ccc27b04a66a0b6758 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Wed, 1 Jan 2025 12:18:33 -0500 Subject: [PATCH] more atoi_simd --- src/xlsx/cells_reader.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/xlsx/cells_reader.rs b/src/xlsx/cells_reader.rs index 3d75d8b..9172b8b 100644 --- a/src/xlsx/cells_reader.rs +++ b/src/xlsx/cells_reader.rs @@ -327,10 +327,7 @@ fn read_v<'s>( ) -> Result, XlsxError> { let cell_format = match get_attribute(c_element.attributes(), QName(b"s")) { Ok(Some(style)) => { - let id: usize = std::str::from_utf8(style) - .unwrap_or("0") - .parse() - .unwrap_or(0); + let id = atoi_simd::parse::(style).unwrap_or(0); formats.get(id) } _ => Some(&CellFormat::Other), @@ -338,7 +335,7 @@ fn read_v<'s>( match get_attribute(c_element.attributes(), QName(b"t"))? { Some(b"s") => { // shared string - let idx: usize = v.parse()?; + let idx = atoi_simd::parse::(v.as_bytes()).unwrap_or(0); Ok(DataRef::SharedString(&strings[idx])) } Some(b"b") => {