From a95a0d834b01ff4a69f91b74efdb6ed7a840439c Mon Sep 17 00:00:00 2001 From: "C. Jeremiah Schneider" Date: Thu, 27 Jan 2022 20:59:04 +0100 Subject: [PATCH] implement `xml_string_to_json` with `sml_str_to_json` --- src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d00af0b..cabf505 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -372,8 +372,7 @@ fn xml_to_map(e: &Element, config: &Config) -> Value { /// Converts the given XML string into `serde::Value` using settings from `Config` struct. pub fn xml_string_to_json(xml: String, config: &Config) -> Result { - let root = Element::from_str(xml.as_str())?; - Ok(xml_to_map(&root, config)) + xml_str_to_json(xml.as_str(), config) } /// Converts the given XML string into `serde::Value` using settings from `Config` struct.