v0.3.0
Pre-release
Pre-release
Breaking Changes
- Improved content fetch interface ergonomics (commit
7b92405):- Replaced
lexical::Analyzer::content()andParser::content()methods that returnedResultwith a three-method approach:fn content(&self) -> Content- panics on error tokenfn err(&self) -> Error- panics on non-error tokenfn try_content(&self) -> Result<Content, Error>- original behavior
- This eliminates the need for unwieldy
.unwrap()and.unwrap_err()calls in parsing loops
- Replaced
- Renamed
BufAnalyzertoFixedAnalyzer(commitf8d9891):- Renamed the main lexical analyzer type to better reflect its purpose (analyzing fixed-size buffers)
- Reduces confusion with the crate name and provides more descriptive naming
- Improved
Content::unescapedergonomics (commit0c33fcb):- Changed
Content::unescapedmethod signature from&mut self -> &str to &mut self -> Cow<'_, str> - Returns
Cow::Borrowedwhen no unescaping is needed,Cow::Ownedwhen it expanded at least one escape sequence.
- Changed
Material Non-Breaking Changes
- Reduced
fixed::Content(formerlybuf::Content) size from 48 to 32 bytes (commit0c33fcb) - Added
Pos::new()constructor (commit4f0527b):- Added convenience constructor for creating
Posinstances:Pos::new(offset, line, col) - Improves testing ergonomics because it's a shorter "phrase"
- Added convenience constructor for creating
- Made
Token::static_content()aconst fn(commit0cf5efb): - Added module-level documentation for
mod lexical(commit48e1025): - Switched from MIT license to dual MIT and Apache-2.0 (commit
ad3f963): - Updated README (commits
4b09f21,746e335,0bd677f):
Full Changelog: v0.2.0...v0.3.0