From 902adfe0ad0401075e7b9fcfa4cc6a3b5f9b4165 Mon Sep 17 00:00:00 2001 From: bokuweb Date: Thu, 3 Sep 2020 11:40:57 +0900 Subject: [PATCH] fix: width reader (#135) --- docx-core/src/reader/attributes/width.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docx-core/src/reader/attributes/width.rs b/docx-core/src/reader/attributes/width.rs index f65932a..4ab9c09 100644 --- a/docx-core/src/reader/attributes/width.rs +++ b/docx-core/src/reader/attributes/width.rs @@ -14,7 +14,7 @@ pub fn read_width(attrs: &[OwnedAttribute]) -> Result<(isize, WidthType), Reader if local_name == "type" { width_type = WidthType::from_str(&a.value)?; } else if local_name == "w" { - w = isize::from_str(&a.value)?; + w = f64::from_str(&a.value).expect("should read width.") as isize; } } Ok((w, width_type))