Skip to content

v0.9.0

Choose a tag to compare

@bluk bluk released this 15 Nov 00:50
· 82 commits to trunk since this release
v0.9.0
59b9f6f

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.