chore(deps): update rust crate winnow to v0.7.0
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
winnow | workspace.dependencies | minor |
0.6 -> 0.7
|
Release Notes
winnow-rs/winnow (winnow)
v0.7.0
Migration Guide
- Upgrade to the latest 0.6 release
- Resolve all deprecations
- Replace
impl Parser<_, _, _>
withimpl ModalParser<_, _, _>
- Upgrade to 0.7.0
- Resolve any compiler errors
- For custom errors, remove switch from
from_error_kind
tofrom_input
and remove otherkind
parameters - For
seq!(<tuple>)
, you may need to addmut
to shared parsers - For
Stream::peek*
calls, update for lack ofStream
being returned - Where
ModalParser
couldn't be used, changeParser<I, O, E>
toParser<I, O, ErrMode<E>>
- Resolve all deprecations
If you do not use cut_err
or Partial
, you can further clean up the code and improve performance by removing the use of ErrMode
- Replace
ModalResult<O, E>
withwinnow::Result<O>
(if using default error type) or justResult<O, E>
- Replace
impl ModalParser
withimpl Parser
- Remove uses of
ErrMode
Compatibility
-
escaped
andtake_escaped
now assert, rather than stop, on emptynormal
output - Some parsers used in
seq(<tuple>)
must now bemut
-
Stream::peek_token
,Stream::peek_slice
,Stream::peek_finish
no longer return a clone ofStream
-
trait Location
s functions have changed to improve parsing of lexed tokens -
ParserError::append
andFromExternalError::from_external_error
skind
parameter has been removed -
ParserError
,AsChar
,ContainsToken
,Stream
were added to the prelude - Some trait bounds changed
- Deprecated functionality removed
- Deprecated
escaped_transform
in favor of the new nameescaped
Features
- Decoupled
ErrMode
from the core traits through newModalError
trait andParserError
modal functions, allowing better performance and greater flexibility - Add
ParserError
,AsChar
,ContainsToken
,Stream
to the prelude - Add
stream::TokenSlice
to help parsing of lexed tokens - Implement
ErrorConvert
forErrMode
Fixes
- Borrow parsers in
seq!(<tuple>)
so they can be used multiple times -
escaped
andtake_escaped
now assert, rather than stop, on emptynormal
output - Improve type inference for
Parser::by_ref
,Parser::complete_err
- Improve error reports for
float
- Added an inherent
ParserError::append
to reduce boilerplate with custom errors - Added support for
TreeError
withbinary::bits
parsers -
escaped
can now have separate types fornormal
andescaped
parsers
Documentation
- Modernized reference examples
v0.6.26
Compatibility
- Deprecate
ParserError::from_error_kind
in favor ofParserError::from_input
- Deprecate
InputError::new
in favor ofInputError::at
- Deprecate
ErrorKind
- If used as an error, consider
EmptyError
- For
ParserError::append
, just add an#[allow(deprecated)]
- If used as an error, consider
Features
- Add
EmptyError
which is like()
but compatible withParser::parse
- Add
ParserError::from_input
to help with the transition to 0.7 - Add
InputError::at
to help with the transition to 0.7
v0.6.25
Compatibility
- Deprecated
PResult
in favor ofModalResult
: v0.7 will makeErrMode
optional andPResult
will no longer be descriptive enough - Deprecate
IResult
in favor ofPResult<(I, O)>
Documentation
- Update comparison with nom
Fixes
- Ensure we append errors in
repeat(_).fold(1..)
v0.6.24
Fixes
- Add back in
winnow::Located
which was removed by accident
v0.6.23
Compatibility
-
stream::Located
is deprecated in favor ofstream::LocatingSlice
-
combnator::rest
is deprecated in favor oftoken::rest
-
combnator::rest_len
is deprecated in favor oftoken::rest_len
-
combinator::<Struct>
have mostly been deprecated in favor ofcombinator::impls::<Struct>
-
unpeek
is deprecated
Features
- Added
repeat().try_fold()
andrepeat().verify_fold()
v0.6.22
Fixes
- Respect
is_partial
intake_till
v0.6.21
Performance
- More inlining
Documentation
- Clarify roles of
peek
andParser::parse_peek
- Provide more context for people coming from
nom
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.