Skip to content

Commit bf5b985

Browse files
committed
[dependencies] update quick-xml to 0.37.1
1 parent 1482389 commit bf5b985

File tree

5 files changed

+29
-12
lines changed

5 files changed

+29
-12
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rust-version = "1.70"
1414
[dependencies]
1515
chrono = { version = "0.4.38", default-features = false, features = ["std"] }
1616
indexmap = "2.5.0"
17-
quick-xml = "0.36.2"
17+
quick-xml = "0.37.1"
1818
newtype-uuid = "1.1.3"
1919
thiserror = "2.0.3"
2020
strip-ansi-escapes = "0.2.0"

src/errors.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) The nextest Contributors
22
// SPDX-License-Identifier: MIT OR Apache-2.0
33

4+
use quick_xml::encoding::EncodingError;
5+
use std::io;
46
use thiserror::Error;
57

68
/// An error that occurs while serializing a [`Report`](crate::Report).
@@ -13,3 +15,19 @@ pub struct SerializeError {
1315
#[from]
1416
inner: quick_xml::Error,
1517
}
18+
19+
impl From<EncodingError> for SerializeError {
20+
fn from(inner: EncodingError) -> Self {
21+
Self {
22+
inner: quick_xml::Error::Encoding(inner),
23+
}
24+
}
25+
}
26+
27+
impl From<io::Error> for SerializeError {
28+
fn from(inner: io::Error) -> Self {
29+
Self {
30+
inner: quick_xml::Error::from(inner),
31+
}
32+
}
33+
}

src/report.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ impl Report {
133133
pub fn to_string(&self) -> Result<String, SerializeError> {
134134
let mut buf: Vec<u8> = vec![];
135135
self.serialize(&mut buf)?;
136-
String::from_utf8(buf).map_err(|utf8_err| quick_xml::Error::from(utf8_err).into())
136+
String::from_utf8(buf).map_err(|utf8_err| {
137+
quick_xml::encoding::EncodingError::from(utf8_err.utf8_error()).into()
138+
})
137139
}
138140
}
139141

src/serialize.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,7 @@ pub(crate) fn serialize_test_suite(
154154
Ok(())
155155
}
156156

157-
fn serialize_property(
158-
property: &Property,
159-
writer: &mut Writer<impl io::Write>,
160-
) -> quick_xml::Result<()> {
157+
fn serialize_property(property: &Property, writer: &mut Writer<impl io::Write>) -> io::Result<()> {
161158
let mut property_tag = BytesStart::new(PROPERTY_TAG);
162159
property_tag.extend_attributes([
163160
("name", property.name.as_str()),
@@ -399,15 +396,15 @@ fn serialize_output(
399396
fn serialize_empty_start_tag(
400397
tag_name: &'static str,
401398
writer: &mut Writer<impl io::Write>,
402-
) -> quick_xml::Result<()> {
399+
) -> io::Result<()> {
403400
let tag = BytesStart::new(tag_name);
404401
writer.write_event(Event::Start(tag))
405402
}
406403

407404
fn serialize_end_tag(
408405
tag_name: &'static str,
409406
writer: &mut Writer<impl io::Write>,
410-
) -> quick_xml::Result<()> {
407+
) -> io::Result<()> {
411408
let end_tag = BytesEnd::new(tag_name);
412409
writer.write_event(Event::End(end_tag))
413410
}

0 commit comments

Comments
 (0)