Skip to content

Releases: bluk/maybe_xml

v0.11.0

16 Dec 21:19
v0.11.0
8911f60

Choose a tag to compare

Updated

  • Breaking change: While the public API has not changed, the underlying code
    has been re-written. By default, the parser code is much stricter and follows
    the XML specification more closely. For this release, the parser only has a
    strict mode. Future versions may have options to relax the parsing code and allow
    non-spec behavior.

Fixed

v0.10.1

02 Dec 08:09
v0.10.1
a9c056b

Choose a tag to compare

Fixed

  • Fix incorrect parsing CDATA issue. The pos was not used when scanning for
    the CDATA.
    Thanks @Mingun.
    See Issue #8

v0.10.0

22 Nov 02:28
v0.10.0
89b96de

Choose a tag to compare

Removed

  • Removed deprecated functionality.

v0.9.0

15 Nov 00:50
v0.9.0
59b9f6f

Choose a tag to compare

Updated

  • Breaking change: Lexer::into_inner() returns a &str.
  • Breaking change: Lexer::tokenize() restores the panic behavior in
    previous versions. If the position argument is greater than the input's byte length,
    then a panic occurs. The position argument is also immediately checked to be
    at a UTF-8 character boundary instead of waiting for a panic in a subsequent
    function call.
  • Breaking change: Spaces around properties like attribute names, attribute
    values, and processing instructions are trimmed in their representations.
  • Breaking change: Minimum supported Rust version is now 1.71.0.
  • Renamed Lexer into Reader. Lexer is still exposed as a hidden alias but will
    be removed in a future version.
  • Token::ty() is made const.

Removed

  • Remove From and from_str implementations from token
    and property types. Due to possible future implementation changes and
    undocumented invariants, the ability to directly construct a type is removed.
  • Remove as_str(), as_bytes(), as_str_unchecked(),
    and into_inner() implementations for Attributes and Attribute. Both are opaque
    types where the internal data may change.

Deprecated

  • Deprecated from_slice_unchecked() on Lexer. Use core::str::from_utf8_unchecked()
    on the byte slice and then pass into Reader::from_str() if the byte slice is
    guaranteed to be a valid UTF-8 string.

Added

  • Most functions are const on the token and property types. Refactored most
    token and property type function implementations to be const compatible.
  • Add Reader::parse() as a const alternative function to
    Reader::tokenize(). The function does not mutate the position argument so the
    position must be re-calculated like pos += token.len() in the calling code.
  • Add Attributes.parse() as a const function to parse the attributes like
    Reader::parse().
  • Add Display implementations to Token and token types.
  • Derive PartialOrd, Ord, and Hash for Token and Ty.
  • Add len() method to token types.

v0.8.0

11 Nov 20:09
v0.8.0
eb92788

Choose a tag to compare

Added

  • Add Token::as_str() and as_str() to other token and property types.
    as_str() replaces to_str() or as_str_unchecked() as the preferred method
    to get the underlying value.
  • Add Token::from_str() and from_str() to other token and property types.
    The method should be used for constructing values in tests.

Deprecated

  • Deprecated as_str_unchecked(), to_str() and into_inner() on Token.
  • Deprecated as_str_unchecked(), to_str() and into_inner() on token types.
  • Deprecated as_str_unchecked() and to_str() on property types.

Removed

  • Remove From<&[u8]> and AsRef<[u8]> implementations from token and property
    types.

Changed

  • Changed the internal implementation of tokens to use &str instead of
    &[u8]. Micro benchmark performance should be similar to the previous
    implementation, but when using as_str() instead of to_str(), the calling
    code does not have to handle a Result type which should increase overall
    performance.

v0.7.2

01 Nov 17:59
v0.7.2
658ec84

Choose a tag to compare

Changed

  • Make Iterator from Lexer::iter() into an explicit type named Iter.

Added

  • Add Lexer::into_inner() to get the underlying bytes passed to the Lexer.
  • Derive PartialEq, Eq, and Hash for Lexer and iterators.

v0.7.1

01 Nov 17:58
v0.7.1
2151e75

Choose a tag to compare

Changed

  • Modify IntoIter to be public.

v0.7.0

30 Oct 18:47
v0.7.0
01519db

Choose a tag to compare

Changed

  • Add Lexer::from_str as the safe instantiation method.
  • Refactor Lexer::from_slice to unsafe Lexer::from_slice_unchecked. It is
    assumed the byte slice is UTF-8 characters, and if they are not a valid slice
    of UTF-8 bytes, then the behavior is undefined.
  • Dynamically determine Token type instead of storing the Ty. This reduces the
    Token size to 2 words (16 octets on a 64-bit machine).

Removed

  • Remove offset field from Token. If required, the offset should be
    calculated when tokens are consumed.
  • Remove scan and Scanner from the public API.
  • Remove const from Token::ty() method for possible future optimizations.
  • Remove public new methods from Token and related types.

Added

  • Add unsafe as_str_unchecked to various types in cases where the bytes are
    guaranteed to be valid UTF-8.
  • Add as_bytes, to_str, as_str_unchecked, and into_inner to Token.

v0.6.0

17 Oct 14:21
v0.6.0
dea4be1

Choose a tag to compare

Changed

  • Change the minimum Rust supported version to 1.56.0 by moving benchmark code
    to own crate.

Removed

  • Removed deprecated functionality.

v0.5.0

29 Sep 02:40
v0.5.0
5ac16f8

Choose a tag to compare

Added

  • Add Lexer type which is the replacement for all evaluators. It borrows the
    input (a slice of bytes) and tokenizes with a borrowed Token. It has the
    benefits of both the existing evaluators (namely borrowing byte slices from the
    input so no allocations are necessary and allowing an Iterator API).
  • Add scan function which scans for a token at the beginning of a slice.

Deprecated

  • Add deprecations to owned token types and all evaluators. The code will be
    removed in a future version.

Fixed

  • Fixed wrong lifetimes in the borrowed token types. The lifetimes should have
    been tied to the borrowed input instead of the token's type.

Changed

  • Derive most trait implementations for token and property types.
  • Change the minimum Rust supported version to 1.60.0 by changing newer
    syntax code like let...else to older supported syntax.
  • Add #[must_use] and const to functions.

Removed

  • Remove Token From implementations and other methods which are available
    when using as_bytes().