Skip to content

fix(deps): update rust crate quick-xml to 0.42 - #82

Open
ferrlabs-renovate[bot] wants to merge 1 commit into
mainfrom
renovate/quick-xml-0.x
Open

fix(deps): update rust crate quick-xml to 0.42#82
ferrlabs-renovate[bot] wants to merge 1 commit into
mainfrom
renovate/quick-xml-0.x

Conversation

@ferrlabs-renovate

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
quick-xml dependencies minor 0.410.42

Release Notes

tafia/quick-xml (quick-xml)

v0.42.0

Compare Source

This is a large release. The primary change is an ergonomic improvement across the entire API -
quick_xml now makes use of &str and String types where possible instead of
&[u8] and Vec<u8>. This requires significant refactoring of downstream code,
but should result in a net simplification as well as potential performance improvements,
and opens up additional opportunities in future releases.

The MSRV has been raised to 1.86. We now use Rust 2024 Edition.

Breaking Changes
  • #​963: Reader now validates that input is valid UTF-8 when constructing events.
    Non-UTF-8 input passed to Reader::from_reader() without DecodingReader will now
    produce Error::Encoding instead of silently passing through invalid bytes.
    Use DecodingReader to transcode non-UTF-8 sources.
  • #​963: Name types (QName, LocalName, Prefix, Namespace, PrefixDeclaration)
    now wrap &str instead of &[u8]. into_inner() returns &str, and AsRef<str>
    is implemented (AsRef<[u8]> has been removed). ResolveResult::Unknown now contains String
    instead of Vec<u8>, and NamespaceError variants contain String instead of Vec<u8>.
  • #​963: Removed the decoder: Decoder field from event types (BytesStart, BytesText,
    BytesCData, BytesRef) and Attributes. The decoder() method is no longer available
    on these types. Decode methods on events now always assume UTF-8 input.
    Error::missed_end() no longer takes a Decoder parameter.
  • #​963: Event types (BytesStart, BytesEnd, BytesText, BytesCData, BytesPI,
    BytesRef) now store Cow<str> internally instead of Cow<[u8]>. into_inner() on
    BytesText, BytesCData, BytesPI, and BytesRef now returns Cow<str>.
    BytesStart::set_name() now takes &str instead of &[u8].
  • #​963: All event types and the Event enum now implement Deref<Target = str>
    instead of Deref<Target = [u8]>. Explicit AsRef<str> impls are provided to
    avoid ambiguity.
  • #​963: Removed decode() methods from BytesText, BytesCData, and BytesRef.
    Content is already available as &str via Deref. The xml10_content(),
    xml11_content(), xml_content(), and html_content() methods now return
    Cow<str> directly instead of Result<Cow<str>, EncodingError>.
  • #​963: Attribute::value is now Cow<'a, str> instead of Cow<'a, [u8]>.
    The From<(&[u8], &[u8])> impl has been removed.
  • #​963: BytesDecl::version(), encoding(), and standalone() now return
    Cow<'_, str> instead of Cow<'_, [u8]>.
  • #​963: Removed Reader::decoder() method. Use Reader::encoding() instead
    (available with the encoding feature). Removed decoder() from the XmlRead
    serde trait. Removed all methods from Decoder (the struct is kept only for
    backward compatibility with deprecated Attribute methods).
  • #​980: NamespaceError::TooManyDeclarations has been renamed to TooManyBindings,
    and NamespaceResolver::set_max_declarations_per_element has been renamed to
    NamespaceResolver::set_max_namespace_bindings, and the semantic behavior has
    changed slightly. The default maximum has also been reduced from 256 to 128.
  • #​1000: DeError::UnexpectedStart renamed to DeError::MixedContent. That error
    is emitted when you try to deserialize boolean, number or string field from
    something like <field>text <tag/> another text</field>.
Bug Fixes
  • #​670: Serde serializer now escapes \r, \n, and \t in attribute values
    as &#&#8203;13;, &#&#8203;10;, and &#&#8203;9; respectively, preventing silent data loss from
    XML attribute-value normalization on round-trip. Likewise Attribute::from
    performs the same transformation.
  • #​953: The serde Deserializer now correctly handles namespaces. Previously
    the namespace bindings might be applied or removed before the event actually
    was consumed which lead to a couple of bugs.
  • #​989: Attributes::new and Attributes::html now return empty iterators when
    their starting position is past the end of the input instead of panicking.
  • #​977: NamespaceResolver::push (and hence every NsReader Start/Empty
    event) now returns the new NamespaceError::TooDeeplyNested when a document
    nests elements deeper than u16::MAX, instead of overflowing the internal
    u16 depth counter. Previously the unguarded nesting_level += 1 panicked
    under overflow-checks builds and silently wrapped in release, corrupting
    namespace-scope bookkeeping on deeply nested untrusted input.
  • #​980: NamespaceResolver now caps the total number of in-scope namespace
    bindings (default 128, configurable via set_max_namespace_bindings),
    replacing the previous per-element max_declarations_per_element limit.
  • #​978: The serde Deserializer now enforces a configurable recursion-depth
    limit (default 128, matching serde_json). Deeply nested XML returns
    DeError::TooDeeplyNested instead of overflowing the native call stack.
    Use Deserializer::recursion_limit() to adjust.
  • #​990: \r in text content is now escaped as &#&#8203;13; by the serde serializer,
    BytesText::new(), escape(), partial_escape(), and minimal_escape(),
    preventing silent conversion to \n from XML end-of-line normalization on
    round-trip. Note that \r cannot be preserved through CDATA serialization
    because character references are not permitted inside CDATA sections.
Misc Changes
  • #​269: Added getting-started examples (getting_started, writer,
    serde_roundtrip, reader_patterns, visitor) and an examples/README.md
    guide on choosing between the serde and pull-reader/writer APIs.
  • #​331: Documentation about lifetimes of the events and attributes has been clarified.
  • #​859: Added an example showing how to pretty-print serialized XML.
  • #​983: Adopted an AI use and contribution policy for new upstream contributions.
  • #​963: MSRV bumped to 1.86 (April 2025)
  • #​963: Deprecated Attribute methods that take a Decoder parameter, since
    attribute values are now always valid UTF-8: decoded_and_normalized_value(),
    decoded_and_normalized_value_with(), decode_and_unescape_value(), and
    decode_and_unescape_value_with(). Use normalized_value() and
    normalized_value_with() instead.
  • #​1002: Added NamespaceResolver::with that allows temporary applying namespace
    bindings from the start tag for the scope of a provided closure F, without making any
    persistent change to the resolver. It is useful to check a peeked event which is
    not yet consumed in custom implementations of peekable reader.
  • #​1002: Added Deserializer::resolver and Deserializer::resolver_mut methods
    to get a namespace resolver used by this deserializer, because it no longer uses
    an NsReader internally.
  • #​1005: Implement Hash, PartialOrd, and Ord across all Bytes* types.

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

@ferrlabs-renovate
ferrlabs-renovate Bot enabled auto-merge (squash) September 5, 2026 10:31

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WHAT CHANGED: 0.42's headline change is byte→string migration across the API. LocalName/Namespace::into_inner() now return &str instead of &[u8], event types (BytesText etc.) now Deref<Target = str> / implement AsRef<str> instead of AsRef<[u8]>, and Reader now rejects non-UTF-8 input instead of passing it through.

WHAT BREAKS HERE: this repo's two DAV XML parsers use exactly the byte-based patterns that were removed, so they won't compile against 0.42:

  • api/src/dav/propfind.rs:58 and :61String::from_utf8_lossy(...) called on local_name().into_inner() / namespace.into_inner(), which are now &str, not &[u8].
  • api/src/dav/propfind.rs:85element.local_name().into_inner() == b"prop" compares &str to a byte-string literal.
  • api/src/dav/locking.rs:209 and :212 — same == b"owner" byte-literal comparison.
  • api/src/dav/locking.rs:214String::from_utf8_lossy(&raw) on a BytesText, which no longer offers &[u8] (its AsRef<[u8]> impl was removed in 0.42).

Blocking: none of these call sites were updated, so the crate does not compile. Fixes are one-liners once you're touching these files, e.g. propfind.rs:85 → element.local_name().into_inner() == "prop", and drop the from_utf8_lossy wrapper on lines 58/61/214 since the values are already valid &str/deref to str. Since propfind.rs/locking.rs aren't part of this diff, I can't attach GitHub suggestion blocks to them here.

WHY CI FAILS: build and Coverage both fail (exit 101, "1 error"). This matches the source-level break above rather than a flake — I couldn't pull the raw compiler text (log requires GitHub auth), but the failure is consistent with a compile error, not an unrelated/pre-existing failure, since main presumably still builds on quick-xml 0.41.

Do not silence this by pinning back the version — the fix is to update the three call sites for the new &str-based API.

@ferrlabs-renovate
ferrlabs-renovate Bot force-pushed the renovate/quick-xml-0.x branch 12 times, most recently from 32e281d to f6d0d2f Compare September 8, 2026 04:13
Signed-off-by: ferrlabs-renovate[bot] <282300760+ferrlabs-renovate[bot]@users.noreply.github.com>
@ferrlabs-renovate
ferrlabs-renovate Bot force-pushed the renovate/quick-xml-0.x branch from f6d0d2f to daecba4 Compare September 10, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants