Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update rust crate quick-xml to 0.37 #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented May 5, 2024

This PR contains the following updates:

Package Type Update Change
quick-xml dependencies minor 0.22 -> 0.37

Release Notes

tafia/quick-xml (quick-xml)

v0.37.0

Compare Source

New Features
  • #​826: Implement From<String> and From<Cow<str>> for quick_xml::de::Text.
  • #​826: Make SimpleTypeDeserializer and SimpleTypeSerializer public.
  • #​826: Implement IntoDeserializer for &mut Deserializer.
Bug Fixes
  • #​655: Do not write indent before and after $text fields and those $value fields
    that are serialized as a text (for example, usize or String).
  • #​826: Handle only those boolean representations that are allowed by Xml Schema
    which is only "true", "1", "false", and "0". Previously the following values
    also was accepted:
    bool XML content
    true "True", "TRUE", "t", "Yes", "YES", "yes", "y"
    false "False", "FALSE", "f", "No", "NO", "no", "n"
Misc Changes
  • #​227: Split SeError from DeError in the serialize feature.
    Serialize functions and methods now return SeError.
  • #​810: Return std::io::Error from Writer methods.
  • #​811: Split NamespaceError and EncodingError from Error.
  • #​811: Renamed Error::EscapeError to Error::Escape to match other variants.
  • #​811: Narrow down error return type from Error where only one variant is ever returned:
    attribute related methods on BytesStart and BytesDecl returns AttrError
  • #​820: Classify output of the Serializer by returning an enumeration with kind of written data
  • #​823: Do not allow serialization of consequent primitives, for example Vec<usize> or
    Vec<String> in $value fields. They cannot be deserialized back with the same result
  • #​827: Make escape and it variants take a impl Into<Cow<str>> argument and implement
    From<(&'a str, Cow<'a, str>)> on Attribute
  • #​826: Removed DeError::InvalidInt, DeError::InvalidFloat and DeError::InvalidBoolean.
    Now the responsibility for returning the error lies with the visitor of the type.
    See ratiohttps://github.com/serde-rs/serde/pull/2811ull/2811

v0.36.2

Compare Source

Bug Fixes
  • #​533: Fix incorrect DocType closing bracket detection when parsing with buffered reader

v0.36.1

Compare Source

New Features
  • #​623: Added Reader::stream() that can be used to read arbitrary data
    from the inner reader while track position for XML reader.

v0.36.0

Compare Source

Bug Fixes
  • #​781: Fix conditions to start CDATA section. Only uppercase <![CDATA[ can start it.
    Previously any case was allowed.
  • #​780: Fixed incorrect .error_position() when encountering syntax error for open or self-closed tag.
Misc Changes
  • #​780: reader::Parser, reader::ElementParser and reader::PiParser moved to the new module parser.
  • #​776: Allow to have attributes in the end tag for compatibility reasons with Adobe Flash XML parser.

v0.35.0

Compare Source

New Features
  • #​772: Add reader::Config::allow_unmatched_ends to permit dangling end tags
Bug Fixes
  • #​773: Fixed reporting incorrect end position in Reader::read_to_end family
    of methods and trimming of the trailing spaces in Reader::read_text when
    trim_text_start is set and the last event is not a Text event.
  • #​771: Character references now allow any number of leading zeroes as it should.
    As a result, the following variants of quick_xml::escape::EscapeError are removed:
    • TooLongDecimal
    • TooLongHexadecimal
  • #​771: Fixed Attribute::unescape_value which does not unescape predefined values since 0.32.0.
  • #​774: Fixed regression since 0.33.0: Text event may be skipped in read_event_into()
    and read_event_into_async() in some circumstances.
Misc Changes
  • #​771: EscapeError::UnrecognizedSymbol renamed to EscapeError::UnrecognizedEntity.
  • #​771: Implemented PartialEq for EscapeError.
  • #​771: Replace the following variants of EscapeError by InvalidCharRef variant
    with a new ParseCharRefError inside:
    • EntityWithNull
    • InvalidDecimal
    • InvalidHexadecimal
    • InvalidCodepoint

v0.34.0

Compare Source

Bug Fixes
  • #​751: Fix internal overflow when read 4GB+ files on 32-bit targets using Reader<impl BufRead> readers.
Misc Changes
  • #​760: Attribute::decode_and_unescape_value and Attribute::decode_and_unescape_value_with now
    accepts Decoder instead of Reader. Use Reader::decoder() to get it.
  • #​760: Writer::write_event now consumes event. Use Event::borrow() if you want to keep ownership.
  • #​751: Type of Reader::error_position() and Reader::buffer_position() changed from usize to u64.
  • #​751: Type alias Span changed from Range<usize> to Range<u64>.

v0.33.0

Compare Source

New Features
  • #​758: Implemented From<QName> for BytesStart and BytesEnd.
Bug Fixes
  • #​755: Fix incorrect missing of trimming all-space text events when
    trim_text_start = false and trim_text_end = true.
Misc Changes
  • #​650: Change the type of Event::PI to a new dedicated BytesPI type.
  • #​759: Make const as much functions as possible:
    • resolve_html5_entity()
    • resolve_predefined_entity()
    • resolve_xml_entity()
    • Attr::key()
    • Attr::value()
    • Attributes::html()
    • Attributes::new()
    • BytesDecl::from_start()
    • Decoder::encoding()
    • Deserializer::get_ref()
    • IoReader::get_ref()
    • LocalName::into_inner()
    • Namespace::into_inner()
    • NsReader::config()
    • NsReader::prefixes()
    • Prefix::into_inner()
    • QName::into_inner()
    • Reader::buffer_position()
    • Reader::config()
    • Reader::decoder()
    • Reader::error_position()
    • Reader::get_ref()
    • SliceReader::get_ref()
    • Writer::get_ref()
    • Writer::new()
  • #​763: Hide quick_xml::escape::resolve_html5_entity under escape-html feature again.
    This function has significant influence to the compilation time (10+ seconds or 5x times)

v0.32.0

Compare Source

The way to configure parser is changed. Now all configuration is contained in the
Config struct and can be applied at once. When serde-types feature is enabled,
configuration is serializable.

The method of reporting positions of errors has changed - use error_position()
to get an offset of the error position. For SyntaxErrors the range
error_position()..buffer_position() also will represent a span of error.

The way of resolve entities with unescape_with are changed. Those methods no longer
resolve predefined entities.

New Features
  • #​513: Allow to continue parsing after getting new Error::IllFormed.
  • #​677: Added methods config() and config_mut() to inspect and change the parser
    configuration. Previous builder methods on Reader / NsReader was replaced by
    direct access to fields of config using reader.config_mut().<...>.
  • #​684: Added a method Config::enable_all_checks to turn on or off all
    well-formedness checks.
  • #​362: Added escape::minimal_escape() which escapes only & and <.
  • #​362: Added BytesCData::minimal_escape() which escapes only & and <.
  • #​362: Added Serializer::set_quote_level() which allow to set desired level of escaping.
  • #​705: Added NsReader::prefixes() to list all the prefixes currently declared.
  • #​629: Added a default case to impl_deserialize_for_internally_tagged_enum macro so that
    it can handle every attribute that does not match existing cases within an enum variant.
  • #​722: Allow to pass owned strings to Writer::create_element. This is breaking change!
  • #​275: Added ElementWriter::new_line() which enables pretty printing elements with multiple attributes.
  • #​743: Added Deserializer::get_ref() to get XML Reader from serde Deserializer
  • #​734: Added helper functions to resolve predefined XML and HTML5 entities:
    • quick_xml::escape::resolve_predefined_entity
    • quick_xml::escape::resolve_xml_entity
    • quick_xml::escape::resolve_html5_entity
  • #​753: Added parser for processing instructions: quick_xml::reader::PiParser.
  • #​754: Added parser for elements: quick_xml::reader::ElementParser.
Bug Fixes
  • #​622: Fix wrong disregarding of not closed markup, such as lone <.
  • #​684: Fix incorrect position reported for Error::IllFormed(DoubleHyphenInComment).
  • #​684: Fix incorrect position reported for Error::IllFormed(MissingDoctypeName).
  • #​704: Fix empty tags with attributes not being expanded when expand_empty_elements is set to true.
  • #​683: Use local tag name when check tag name against possible names for field.
  • #​753: Correctly determine end of processing instructions and XML declaration.
Misc Changes
  • #​675: Minimum supported version of serde raised to 1.0.139
  • #​675: Rework the quick_xml::Error type to provide more accurate information:
    • Error::EndEventMismatch replaced by IllFormedError::MismatchedEndTag in some cases
    • Error::EndEventMismatch replaced by IllFormedError::UnmatchedEndTag in some cases
    • Error::TextNotFound was removed because not used
    • Error::UnexpectedBang replaced by SyntaxError
    • Error::UnexpectedEof replaced by SyntaxError in some cases
    • Error::UnexpectedEof replaced by IllFormedError in some cases
    • Error::UnexpectedToken replaced by IllFormedError::DoubleHyphenInComment
    • Error::XmlDeclWithoutVersion replaced by IllFormedError::MissingDeclVersion (in #​684)
    • Error::EmptyDocType replaced by IllFormedError::MissingDoctypeName (in #​684)
  • #​684: Changed positions reported for SyntaxErrors: now they are always points
    to the start of markup (i. e. to the < character) with error. Use error_position()
    for that.
  • #​684: Now <??> parsed as Event::PI with empty content instead of raising
    syntax error.
  • #​684: Now <?xml?> parsed as Event::Decl instead of Event::PI.
  • #​362: Now default quote level is QuoteLevel::Partial when using serde serializer.
  • #​689: buffer_position() now always report the position the parser last seen.
    To get an error position use error_position().
  • #​738: Add an example of how to deserialize XML elements into Rust enums using an
    intermediate custom deserializer.
  • #​748: Implement Clone for [DeEvent][DeEvent], [PayloadEvent][PayloadEvent] and [Text][Text].
  • #​734: Rename NoEntityResolver to PredefinedEntityResolver.
  • #​734: No longer resolve predefined entities (lt, gt, apos, quot, amp)
    in unescape_with family of methods. You should do that by yourself using the methods
    listed above.

v0.31.0

Compare Source

MSRV bumped to 1.56! Crate now uses Rust 2021 edition.

Enum representation was changed (it was buggy anyway) to ensure compatibility with
serde >= 1.0.181

New Features
  • #​545: Resolve well-known namespaces (xml and xmlns) to their appropriate URIs.
    Also, enforce namespace constraints related to these well-known namespaces.
  • #​635: Add support for async ElementWriter operations.
Bug Fixes
  • #​660: Fixed incorrect deserialization of xs:lists from empty tags (<tag/>
    or <tag></tag>). Previously an DeError::UnexpectedEof") was returned in that case
  • #​580: Fixed incorrect deserialization of vectors of newtypes from sequences of tags.
  • #​661: More string handling of serialized primitive values (booleans, numbers, strings,
    unit structs, unit variants). <int>123<something-else/></int> is no longer valid
    content. Previously all data after 123 up to closing tag would be silently skipped.
  • #​567: Fixed incorrect deserialization of vectors of enums from sequences of tags.
  • #​671: Fixed deserialization of empty simpleTypes (for example, attributes) into
    Option fields: now they are always deserialized as Some("").
Misc Changes
  • #​643: Bumped MSRV to 1.56. In practice the previous MSRV was incorrect in many cases.
  • #​643: Adopted Rust 2021 edition.
  • #​545: Added new Error variant -- Error::InvalidPrefixBind.
  • #​651: Relax requirement for version of arbitrary dependency -- we're actually
    compatible with version 1.0.0 and up.
  • #​649: Make features linkable and reference them in the docs.
  • #​619: Allow to raise application errors in ElementWriter::write_inner_content
    (and newly added ElementWriter::write_inner_content_async of course).
  • #​662: Get rid of some allocations during serde deserialization.
  • #​665: Improve serialization of xs:lists when some elements serialized to an empty string.
  • #​630: Fixed compatibility with serde >= 1.0.181

v0.30.0

Compare Source

New Features
  • #​609: Added Writer::write_serializable to provide the capability to serialize
    arbitrary types using serde when using the lower-level Writer API.
  • #​615: Added ability to set entity resolver when deserialize using borrowing reader.
  • #​617: Added ability to enforce the expansion of empty elements.
Bug Fixes
  • #​604: Avoid crashing on wrong comments like <!--> when using read_event_into* functions.
Misc Changes

v0.29.0

Compare Source

New Features
  • #​601: Add serde_helper module to the crate root with some useful utility
    functions and document using of enum's unit variants as a text content of element.
  • #​606: Implement indentation for AsyncWrite trait implementations.
Bug Fixes
  • #​603: Fix a regression from #​581 that an XML comment or a processing
    instruction between a <!DOCTYPE> and the root element in the file broke
    deserialization of structs by returning DeError::ExpectedStart
  • #​608: Return a new error Error::EmptyDocType on empty doctype instead
    of crashing because of a debug assertion.
Misc Changes
  • #​594: Add a helper macro to help deserialize internally tagged enums
    with Serde, which doesn't work out-of-the-box due to serde limitations.

v0.28.2

Compare Source

New Features
  • #​581: Allow Deserializer to set quick_xml::de::EntityResolver for
    resolving unknown entities that would otherwise cause the parser to return
    an [EscapeError::UnrecognizedSymbol] error.
Misc Changes
  • #​584: Export EscapeError from the crate
  • #​581: Relax requirements for unsescape_* set of functions -- their now use
    FnMut instead of Fn for resolve_entity parameters, like Iterator::map
    from std.

v0.28.1

Compare Source

Misc Changes
  • #​579: ElementWriter.write_inner_content now uses a FnOnce instead of a more restrictive Fn closure

v0.28.0

Compare Source

New Features
  • #​541: (De)serialize specially named $text enum variant in externally tagged
    enums to / from textual content
  • #​556: to_writer and to_string now accept ?Sized types
  • #​556: Add new to_writer_with_root and to_string_with_root helper functions
  • #​520: Add methods BytesText::inplace_trim_start and BytesText::inplace_trim_end
    to trim leading and trailing spaces from text events
  • #​565: Allow deserialize special field names $value and $text into borrowed
    fields when use serde deserializer
  • #​568: Rename Writer::inner into Writer::get_mut
  • #​568: Add method Writer::get_ref
  • #​569: Rewrite the Reader::read_event_into_async as an async fn, making the future Send if possible.
  • #​571: Borrow element names (<element>) when deserialize with serde.
    This change allow to deserialize into HashMap<&str, T>, for example
  • #​573: Add basic support for async byte writers via tokio's AsyncWrite.
Bug Fixes
  • #​537: Restore ability to deserialize attributes that represents XML namespace
    mappings (xmlns:xxx) that was broken since #​490
  • #​510: Fix an error of deserialization of Option<T> fields where T is some
    sequence type (for example, Vec or tuple)
  • #​540: Fix a compilation error (probably a rustc bug) in some circumstances.
    Serializer::new and Serializer::with_root now accepts only references to Writer.
  • #​520: Merge consequent (delimited only by comments and processing instructions)
    texts and CDATA when deserialize using serde deserializer. DeEvent::Text and
    DeEvent::CData events was replaced by DeEvent::Text with merged content.
    The same behavior for the Reader does not implemented (yet?) and should be
    implemented manually
  • #​562: Correctly set minimum required version of memchr dependency to 2.1
  • #​565: Correctly set minimum required version of tokio dependency to 1.10
  • #​565: Fix compilation error when build with serde <1.0.139

v0.27.1

Compare Source

Bug Fixes
  • #​530: Fix an infinite loop leading to unbounded memory consumption that occurs when
    skipping events on malformed XML with the overlapped-lists feature active.
  • #​530: Fix an error in the Deserializer::read_to_end when overlapped-lists
    feature is active and malformed XML is parsed

v0.27.0

Compare Source

New Features
  • #​521: Implement Clone for all error types. This required changing Error::Io to contain
    Arc<std::io::Error> instead of std::io::Error since std::io::Error does not implement
    Clone.
Bug Fixes
  • #​490: Ensure that serialization of map keys always produces valid XML names.
    In particular, that means that maps with numeric and numeric-like keys (for
    example, "42") no longer can be serialized because XML name cannot start
    from a digit
  • #​500: Fix deserialization of top-level sequences of enums, like
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- list of enum Enum { A, B, С } -->
    <A/>
    <B/>
    <C/>
  • #​514: Fix wrong reporting Error::EndEventMismatch after disabling and enabling
    .check_end_names
  • #​517: Fix swapped codes for \r and \n characters when escaping them
  • #​523: Fix incorrect skipping text and CDATA content before any map-like structures
    in serde deserializer, like
    unwanted text<struct>...</struct>
  • #​523: Fix incorrect handling of xs:lists with encoded spaces: they still
    act as delimiters, which is confirmed also by mature XmlBeans Java library
  • #​473: Fix a hidden requirement to enable serde's derive feature to get
    quick-xml's serialize feature for edition = 2021 or resolver = 2 crates
Misc Changes
  • #​490: Removed $unflatten= special prefix for fields for serde (de)serializer, because:

    • it is useless for deserializer
    • serializer was rewritten and does not require it anymore

    This prefix allowed you to serialize struct field as an XML element and now
    replaced by a more thoughtful system explicitly indicating that a field should
    be serialized as an attribute by prepending @ character to its name

  • #​490: Removed $primitive= prefix. That prefix allowed you to serialize struct
    field as an attribute instead of an element and now replaced by a more thoughtful
    system explicitly indicating that a field should be serialized as an attribute
    by prepending @ character to its name

  • #​490: In addition to the $value special name for a field a new $text
    special name was added:

    • $text is used if you want to map field to text content only. No markup is
      expected (but text can represent a list as defined by xs:list type)
    • $value is used if you want to map elements with different names to one field,
      that should be represented either by an enum, or by sequence of enums
      (Vec, tuple, etc.), or by string. Use it when you want to map field to any
      content of the field, text or markup

    Refer to documentation for details.

  • #​521: MSRV bumped to 1.52.

  • #​473: serde feature that used to make some types serializable, renamed to serde-types

  • #​528: Added documentation for XML to serde mapping

v0.26.0

Compare Source

Misc Changes
  • #​481: Removed the uses of const fn added in version 0.24 in favor of a lower minimum
    supported Rust version (1.46.0). Minimum supported Rust version is now verified in the CI.
  • #​489: Reduced the size of the package uploaded into the crates.io by excluding
    tests, examples, and benchmarks.

v0.25.0

Compare Source

Bug Fixes
  • #​469: Fix incorrect parsing of CDATA and comments when using buffered readers
Misc Changes
  • #​468: Content of DeError::Unsupported changed from &'static str to Cow<'static, str>
  • #​468: Ensure that map keys are restricted to only types that can be serialized as primitives

v0.24.1

Compare Source

Bug Fixes
  • #​469: Fix incorrect parsing of CDATA and comments when using buffered readers

v0.24.0

Compare Source

New Features
  • #​387: Allow overlapping between elements of sequence and other elements
    (using new feature overlapped-lists)
  • #​393: New module name with QName, LocalName, Namespace, Prefix
    and PrefixDeclaration wrappers around byte arrays and ResolveResult with
    the result of namespace resolution
  • #​180: Make Decoder struct public. You already had access to it via the
    Reader::decoder() method, but could not name it in the code. Now the preferred
    way to access decoding functionality is via this struct
  • #​395: Add support for XML Schema xs:list
  • #​324: Reader::from_str / Deserializer::from_str / from_str now ignore
    the XML declared encoding and always use UTF-8
  • #​416: Add borrow() methods in all event structs which allows to get
    a borrowed version of any event
  • #​437: Split out namespace reading functionality to a dedicated NsReader, namely:
    Old function in Reader New function in NsReader
    read_event -- borrow from input
    read_resolved_event -- borrow from input
    read_event_into
    read_namespaced_event read_resolved_event_into
    resolve
    event_namespace resolve_element
    attribute_namespace resolve_attribute
  • #​439: Added utilities detect_encoding() and decode() under the quick-xml::encoding namespace.
  • #​450: Added support of asynchronous tokio readers
  • #​455: Change return type of all read_to_end* methods to return a span between tags
  • #​455: Added Reader::read_text method to return a raw content (including markup) between tags
  • #​459: Added a Writer::write_bom() method for inserting a Byte-Order-Mark into the document.
  • #​467: The following functions made const:
    • Attr::key
    • Attr::value
    • Attributes::html
    • Attributes::new
    • BytesDecl::from_start
    • Decoder::encoding
    • LocalName::into_inner
    • Namespace::into_inner
    • Prefix::into_inner
    • QName::into_inner
    • Reader::buffer_position
    • Reader::decoder
    • Reader::get_ref
    • Serializer::new
    • Serializer::with_root
    • Writer::new
Bug Fixes
  • #​9: Deserialization erroneously was successful in some cases where error is expected.
    This broke deserialization of untagged enums which rely on error if variant cannot be parsed
  • #​387: Allow to have an ordinary elements together with a $value field
  • #​387: Internal deserializer state can be broken when deserializing a map with
    a sequence field (such as Vec<T>), where elements of this sequence contains
    another sequence. This error affects only users with the serialize feature enabled
  • #​393: Now event_namespace, attribute_namespace and read_event_namespaced
    returns ResolveResult::Unknown if prefix was not registered in namespace buffer
  • #​393: Fix breaking processing after encounter an attribute with a reserved name (started with "xmlns")
  • #​363: Do not generate empty Event::Text events
  • #​412: Fix using incorrect encoding if read_to_end family of methods or read_text
    method not found a corresponding end tag and reader has non-UTF-8 encoding
  • #​421: Fix incorrect order of unescape and decode operations for serde deserializer:
    decoding should be first, unescape is the second
  • #​421: Fixed unknown bug in serde deserialization of externally tagged enums
    when an enum variant represented as a Text event (i.e. <xml>tag</xml>)
    and a document encoding is not an UTF-8
  • #​434: Fixed incorrect error generated in some cases by serde deserializer
  • #​445: Use local name without namespace prefix when selecting enum variants based on element names
    in a serde deserializer
Misc Changes
  • #​8: Changes in the error type DeError:

    Variant Change
    DeError::Text Removed because never raised
    DeError::InvalidEnum Removed because never raised
    DeError::Xml Renamed to DeError::InvalidXml for consistency with DeError::InvalidBoolean
    DeError::Int Renamed to DeError::InvalidInt for consistency with DeError::InvalidBoolean
    DeError::Float Renamed to DeError::InvalidFloat for consistency with DeError::InvalidBoolean
    DeError::Start Renamed to DeError::UnexpectedStart and tag name added to an error
    DeError::End Renamed to DeError::UnexpectedEnd and tag name added to an error
    DeEvent::Eof Renamed to DeError::UnexpectedEof
    DeError::EndOfAttributes Renamed to DeError::KeyNotFound
    DeError::ExpectedStart Added
  • #​391: Added code coverage

  • #​393: event_namespace and attribute_namespace now accept QName
    and returns ResolveResult and LocalName, read_event_namespaced now
    returns ResolveResult instead of Option<[u8]>

  • #​393: Types of Attribute::key and Attr::key() changed to QName

  • #​393: Now BytesStart::name() and BytesEnd::name() returns QName, and
    BytesStart::local_name() and BytesEnd::local_name() returns LocalName

  • #​191: Remove unused reader.decoder().decode_owned(). If you ever used it,
    use String::from_utf8 instead (which that function did)

  • #​191: Remove *_without_bom methods from the Attributes struct because they are useless.
    Use the same-named methods without that suffix instead. Attribute values cannot contain BOM

  • #​191: Remove Reader::decode() and Reader::decode_without_bom(), they are replaced by
    Decoder::decode() and nothing.
    Use reader.decoder().decode_*(...) instead of reader.decode_*(...) for now.
    Reader::encoding() is replaced by Decoder::encoding() as well

  • #​180: Eliminated the differences in the decoding API when feature encoding enabled and when it is
    disabled. Signatures of functions are now the same regardless of whether or not the feature is
    enabled, and an error will be returned instead of performing replacements for invalid characters
    in both cases.

    Previously, if the encoding feature was enabled, decoding functions would return Result<Cow<&str>>
    while without this feature they would return Result<&str>. With this change, only Result<Cow<&str>>
    is returned regardless of the status of the feature.

  • #​180: Error variant Error::Utf8 replaced by Error::NonDecodable

  • #​118: Remove BytesStart::unescaped* set of methods because they could return wrong results
    Use methods on Attribute instead

  • #​403: Remove deprecated quick_xml::de::from_bytes and Deserializer::from_borrowing_reader

  • #​412: Rename methods of Reader:

    Old Name New Name
    read_event read_event_into
    read_to_end read_to_end_into
    read_text read_text_into
    read_event_unbuffered read_event
    read_to_end_unbuffered read_to_end
  • #​412: Change read_to_end* and read_text_into to accept QName instead of AsRef<[u8]>

  • #​415: Changed custom entity unescaping API to accept closures rather than a mapping of entity to
    replacement text. This avoids needing to allocate a map and provides the user with more flexibility.

  • #​415: Renamed functions for consistency across the API:

    Old Name New Name
    *_with_custom_entities *_with
    BytesText::unescaped() BytesText::unescape()
    Attribute::unescaped_* Attribute::unescape_*
  • #​329: Also, that functions now borrow from the input instead of event / attribute

  • #​416: BytesStart::to_borrowed renamed to BytesStart::borrow, the same method
    added to all events

  • #​421: decode_and_unescape* methods now does one less allocation if unescaping is not required

  • #​421: Removed ability to deserialize byte arrays from serde deserializer.
    XML is not able to store binary data directly, you should always use some encoding
    scheme, for example, HEX or Base64

  • #​421: All unescaping functions now accepts and returns strings instead of byte slices

  • #​423: All escaping functions now accepts and returns strings instead of byte slices

  • #​423: Removed BytesText::from_plain because it internally did escaping of a byte array,
    but since now escaping works on strings. Use BytesText::new instead

  • #​428: Removed BytesText::escaped(). Use .as_ref() provided by Deref impl instead.

  • #​428: Removed BytesText::from_escaped(). Use constructors from strings instead,
    because writer anyway works in UTF-8 only

  • #​428: Removed BytesCData::new(). Use constructors from strings instead,
    because writer anyway works in UTF-8 only

  • #​428: Changed the event and Attributes constructors to accept a &str slices instead of &[u8] slices.
    Handmade events has always been assumed to store their content UTF-8 encoded.

  • #​428: Removed Decoder parameter from _and_decode versions of functions for
    BytesText (remember, that those functions was renamed in #​415).

  • #​431: Changed event constructors:

    Old names New name
    BytesStart::owned_name(impl Into<Vec<u8>>) BytesStart::new(impl Into<Cow<str>>)
    BytesStart::borrowed_name(&[u8]) (as above)
    BytesStart::owned(impl Into<Vec<u8>>, usize) BytesStart::from_content(impl Into<Cow<str>>, usize)
    BytesStart::borrowed(&[u8], usize) (as above)
    BytesEnd::owned(Vec<u8>) BytesEnd::new(impl Into<Cow<str>>)
    BytesEnd::borrowed(&[u8]) (as above)
    BytesText::from_escaped(impl Into<Cow<[u8]>>) BytesText::from_escaped(impl Into<Cow<str>>)
    BytesText::from_escaped_str(impl Into<Cow<str>>) (as above)
    BytesText::from_plain(&[u8]) BytesText::new(&str)
    BytesText::from_plain_str(&str) (as above)
    BytesCData::new(impl Into<Cow<[u8]>>) BytesCData::new(impl Into<Cow<str>>)
    BytesCData::from_str(&str) (as above)
  • #​440: Removed Deserializer::from_slice and quick_xml::de::from_slice methods because deserializing from a byte
    array cannot guarantee borrowing due to possible copying while decoding.

  • #​455: Removed Reader::read_text_into which is just a thin wrapper over match on Event::Text

  • #​456: Reader and writer stuff grouped under reader and writer modules.
    You still can use re-exported definitions from a crate root

  • #​459: Made the Writer::write() method non-public as writing random bytes to a document is not generally useful or desirable.

  • #​459: BOM bytes are no longer emitted as Event::Text. To write a BOM, use Writer::write_bom().

  • #​467: Removed Deserializer::new because it cannot be used outside of the quick-xml crate

New Tests
  • #​9: Added tests for incorrect nested tags in input
  • #​387: Added a bunch of tests for sequences deserialization
  • #​393: Added more tests for namespace resolver
  • #​393: Added tests for reserved names (started with "xml"i) -- see https://www.w3.org/TR/xml-names11/#xmlReserved
  • #​363: Add tests for Reader::read_event_impl to ensure that proper events generated for corresponding inputs
  • #​407: Improved benchmark suite to cover whole-document parsing, escaping and unescaping text
  • #​418: Parameterized macrobenchmarks and comparative benchmarks, added throughput measurements via criterion
  • #​434: Added more tests for serde deserializer
  • #​443: Now all documents in /tests/documents are checked out with LF eol in working copy (except sample_5_utf16bom.xml)

Legend:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: White-space, formatting, missing semi-colons, etc
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing tests
  • chore: Changes to the build process or auxiliary tools/libraries/documentation

v0.23.1

Compare Source

Bug Fixes
  • #​469: Fix incorrect parsing of CDATA and comments when using buffered readers

v0.23.0

Compare Source

  • feat: add support for i128 / u128 in attributes or text/CDATA content
  • test: add tests for malformed inputs for serde deserializer
  • fix: allow to deserialize units from any data in attribute values and text nodes
  • refactor: unify errors when EOF encountered during serde deserialization
  • test: ensure that after deserializing all XML was consumed
  • feat: add Deserializer::from_str, Deserializer::from_slice and Deserializer::from_reader
  • refactor: deprecate from_bytes and Deserializer::from_borrowing_reader because
    they are fully equivalent to from_slice and Deserializer::new
  • refactor: reduce number of unnecessary copies when deserialize numbers/booleans/identifiers
    from the attribute and element names and attribute values
  • fix: allow to deserialize units from text and CDATA content.
    DeError::InvalidUnit variant is removed, because after fix it is no longer used
  • fix: ElementWriter, introduced in #​274
    (0.23.0-alpha2) now available to end users
  • fix: allow lowercase <!doctype > definition (used in HTML 5) when parse document from &[u8]
  • test: add tests for consistence behavior of buffered and borrowed readers
  • fix: produce consistent error positions in buffered and borrowed readers
  • feat: Error::UnexpectedBang now provide the byte found
  • refactor: unify code for buffered and borrowed readers
  • fix: fix internal panic message when parse malformed XML
    (#​344)
  • test: add tests for trivial documents (empty / only comment / <root>...</root> -- one tag with content)
  • fix: CDATA was not handled in many cases where it should
  • fix: do not unescape CDATA content because it never escaped by design.
    CDATA event data now represented by its own BytesCData type
    (quick-xml#311)
  • feat: add Reader::get_ref() and Reader::get_mut(), rename
    Reader::into_underlying_reader() to Reader::into_inner()
  • refactor: now Attributes::next() returns a new type AttrError when attribute parsing failed
    (#​4)
  • test: properly test all paths of attributes parsing (#​4)
  • feat: attribute iterator now implements FusedIterator (#​4)
  • fix: fixed many errors in attribute parsing using iterator, returned from attributes()
    or html_attributes() (#​4)

Configuration

📅 Schedule: 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.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


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

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/quick-xml-0.x branch from b2cd786 to 52f8c7e Compare June 10, 2024 16:22
@renovate renovate bot changed the title fix(deps): update rust crate quick-xml to 0.31 fix(deps): update rust crate quick-xml to 0.32 Jun 10, 2024
@renovate renovate bot force-pushed the renovate/quick-xml-0.x branch from 52f8c7e to 6289065 Compare June 21, 2024 16:52
@renovate renovate bot changed the title fix(deps): update rust crate quick-xml to 0.32 fix(deps): update rust crate quick-xml to 0.33 Jun 21, 2024
@renovate renovate bot force-pushed the renovate/quick-xml-0.x branch from 6289065 to 31f5076 Compare June 24, 2024 20:20
@renovate renovate bot changed the title fix(deps): update rust crate quick-xml to 0.33 fix(deps): update rust crate quick-xml to 0.34 Jun 24, 2024
@renovate renovate bot force-pushed the renovate/quick-xml-0.x branch from 31f5076 to 4bde4ab Compare June 29, 2024 17:21
@renovate renovate bot changed the title fix(deps): update rust crate quick-xml to 0.34 fix(deps): update rust crate quick-xml to 0.35 Jun 29, 2024
@renovate renovate bot force-pushed the renovate/quick-xml-0.x branch from 4bde4ab to a79f3ed Compare July 8, 2024 17:28
@renovate renovate bot changed the title fix(deps): update rust crate quick-xml to 0.35 fix(deps): update rust crate quick-xml to 0.36 Jul 8, 2024
@renovate renovate bot force-pushed the renovate/quick-xml-0.x branch from a79f3ed to a0878bf Compare September 11, 2024 07:29
@renovate renovate bot force-pushed the renovate/quick-xml-0.x branch from a0878bf to 84d3b23 Compare October 27, 2024 22:37
@renovate renovate bot changed the title fix(deps): update rust crate quick-xml to 0.36 fix(deps): update rust crate quick-xml to 0.37 Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants