Releases: bluk/maybe_xml
Releases · bluk/maybe_xml
v0.11.0
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
v0.10.0
v0.9.0
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
LexerintoReader.Lexeris still exposed as a hidden alias but will
be removed in a future version. Token::ty()is madeconst.
Removed
- Remove
Fromandfrom_strimplementations 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(),
andinto_inner()implementations forAttributesandAttribute. Both are opaque
types where the internal data may change.
Deprecated
- Deprecated
from_slice_unchecked()onLexer. Usecore::str::from_utf8_unchecked()
on the byte slice and then pass intoReader::from_str()if the byte slice is
guaranteed to be a valid UTF-8 string.
Added
- Most functions are
conston the token and property types. Refactored most
token and property type function implementations to beconstcompatible. - Add
Reader::parse()as aconstalternative function to
Reader::tokenize(). The function does not mutate the position argument so the
position must be re-calculated likepos += token.len()in the calling code. - Add
Attributes.parse()as aconstfunction to parse the attributes like
Reader::parse(). - Add
Displayimplementations toTokenand token types. - Derive
PartialOrd,Ord, andHashforTokenandTy. - Add
len()method to token types.
v0.8.0
Added
- Add
Token::as_str()andas_str()to other token and property types.
as_str()replacesto_str()oras_str_unchecked()as the preferred method
to get the underlying value. - Add
Token::from_str()andfrom_str()to other token and property types.
The method should be used for constructing values in tests.
Deprecated
- Deprecated
as_str_unchecked(),to_str()andinto_inner()onToken. - Deprecated
as_str_unchecked(),to_str()andinto_inner()on token types. - Deprecated
as_str_unchecked()andto_str()on property types.
Removed
- Remove
From<&[u8]>andAsRef<[u8]>implementations from token and property
types.
Changed
- Changed the internal implementation of tokens to use
&strinstead of
&[u8]. Micro benchmark performance should be similar to the previous
implementation, but when usingas_str()instead ofto_str(), the calling
code does not have to handle aResulttype which should increase overall
performance.
v0.7.2
v0.7.1
v0.7.0
Changed
- Add
Lexer::from_stras the safe instantiation method. - Refactor
Lexer::from_sliceto unsafeLexer::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
Tokentype instead of storing theTy. This reduces the
Tokensize to 2 words (16 octets on a 64-bit machine).
Removed
- Remove
offsetfield fromToken. If required, the offset should be
calculated when tokens are consumed. - Remove
scanandScannerfrom the public API. - Remove
constfromToken::ty()method for possible future optimizations. - Remove public
newmethods fromTokenand related types.
Added
- Add unsafe
as_str_uncheckedto various types in cases where the bytes are
guaranteed to be valid UTF-8. - Add
as_bytes,to_str,as_str_unchecked, andinto_innertoToken.
v0.6.0
v0.5.0
Added
- Add
Lexertype which is the replacement for all evaluators. It borrows the
input (a slice of bytes) and tokenizes with a borrowedToken. It has the
benefits of both the existing evaluators (namely borrowing byte slices from the
input so no allocations are necessary and allowing anIteratorAPI). - Add
scanfunction 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.0by changing newer
syntax code likelet...elseto older supported syntax. - Add
#[must_use]andconstto functions.
Removed
- Remove Token
Fromimplementations and other methods which are available
when usingas_bytes().