Skip to content

Commit c0c6c69

Browse files
committed
more atoi_simd
1 parent 93ada77 commit c0c6c69

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/xlsx/cells_reader.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -327,18 +327,15 @@ fn read_v<'s>(
327327
) -> Result<DataRef<'s>, XlsxError> {
328328
let cell_format = match get_attribute(c_element.attributes(), QName(b"s")) {
329329
Ok(Some(style)) => {
330-
let id: usize = std::str::from_utf8(style)
331-
.unwrap_or("0")
332-
.parse()
333-
.unwrap_or(0);
330+
let id = atoi_simd::parse::<usize>(style).unwrap_or(0);
334331
formats.get(id)
335332
}
336333
_ => Some(&CellFormat::Other),
337334
};
338335
match get_attribute(c_element.attributes(), QName(b"t"))? {
339336
Some(b"s") => {
340337
// shared string
341-
let idx: usize = v.parse()?;
338+
let idx = atoi_simd::parse::<usize>(v.as_bytes()).unwrap_or(0);
342339
Ok(DataRef::SharedString(&strings[idx]))
343340
}
344341
Some(b"b") => {

0 commit comments

Comments
 (0)