diff --git a/crates/formats/src/sheet.rs b/crates/formats/src/sheet.rs index c7f6c5ceb..1689b500b 100644 --- a/crates/formats/src/sheet.rs +++ b/crates/formats/src/sheet.rs @@ -824,7 +824,8 @@ fn iso_time(v: &str) -> Option { return Some(if s == 0 { format!("{h:02}:{m:02}") } else { format!("{h:02}:{m:02}:{s:02}") }); } // xs:time: hh:mm[:ss[.sss]][Z|+...] - let hms: Vec = t.split(['Z', '+', '-']).next().unwrap_or("").split(':').filter_map(|p| p.split('.').next().and_then(|x| x.parse().ok())).collect(); + let hms: Vec = + t.split(['Z', '+', '-']).next().unwrap_or("").split(':').filter_map(|p| p.split('.').next().and_then(|x| x.parse().ok())).collect(); if let [h, mi, rest @ ..] = hms.as_slice() { let s = rest.first().copied().unwrap_or(0); return Some(if s == 0 { format!("{h:02}:{mi:02}") } else { format!("{h:02}:{mi:02}:{s:02}") }); @@ -994,9 +995,7 @@ fn ods_value(c: &OCell) -> String { ("date", Some(v)) => iso_datetime(v).unwrap_or_else(|| c.text.clone()), ("time", Some(v)) => iso_time(v).unwrap_or_else(|| c.text.clone()), ("boolean", Some(v)) => if v.eq_ignore_ascii_case("true") || v == "1" { "TRUE" } else { "FALSE" }.into(), - ("percentage" | "currency", Some(v)) if c.text.trim().is_empty() => { - v.parse::().map(number).unwrap_or_else(|_| c.text.clone()) - } + ("percentage" | "currency", Some(v)) if c.text.trim().is_empty() => v.parse::().map(number).unwrap_or_else(|_| c.text.clone()), ("string", Some(v)) if c.text.trim().is_empty() => v.to_string(), _ => c.text.clone(), }