From 291a146466aab88311a39d8c0b57d9eb55cad374 Mon Sep 17 00:00:00 2001 From: 132ikl <132@ikl.sh> Date: Sun, 9 Mar 2025 01:29:51 -0500 Subject: [PATCH] Clippy --- crates/nu-command/src/formats/from/xml.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/nu-command/src/formats/from/xml.rs b/crates/nu-command/src/formats/from/xml.rs index 12ee0eb855..7db7b20c79 100644 --- a/crates/nu-command/src/formats/from/xml.rs +++ b/crates/nu-command/src/formats/from/xml.rs @@ -206,8 +206,10 @@ fn from_document_to_value(d: &roxmltree::Document, info: &ParsingInfo) -> Value } fn from_xml_string_to_value(s: &str, info: &ParsingInfo) -> Result { - let mut options = ParsingOptions::default(); - options.allow_dtd = info.allow_dtd; + let options = ParsingOptions { + allow_dtd: info.allow_dtd, + ..Default::default() + }; let parsed = roxmltree::Document::parse_with_options(s, options)?; Ok(from_document_to_value(&parsed, info)) @@ -295,7 +297,7 @@ fn process_xml_parse_error(source: String, err: roxmltree::Error, span: Span) -> make_xml_error_spanned("Invalid name.", source, pos) } roxmltree::Error::NonXmlChar(_, pos) => { - make_xml_error_spanned(format!("Non-XML character found. Valid characters are: "), source, pos) + make_xml_error_spanned("Non-XML character found. Valid characters are: ", source, pos) } roxmltree::Error::InvalidChar(expected, actual, pos) => { make_xml_error_spanned(