Skip to content

chore(deps): update rust crate winnow to v0.7.0

renovate requested to merge renovate/winnow-0.x into main

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

Compare Source

Migration Guide
  1. Upgrade to the latest 0.6 release
  2. Resolve all deprecations
  3. Replace impl Parser<_, _, _> with impl ModalParser<_, _, _>
  4. Upgrade to 0.7.0
  5. Resolve any compiler errors
  • For custom errors, remove switch from from_error_kind to from_input and remove other kind parameters
  • For seq!(<tuple>), you may need to add mut to shared parsers
  • For Stream::peek* calls, update for lack of Stream being returned
  • Where ModalParser couldn't be used, change Parser<I, O, E> to Parser<I, O, ErrMode<E>>
  1. 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> with winnow::Result<O> (if using default error type) or just Result<O, E>
  • Replace impl ModalParser with impl Parser
  • Remove uses of ErrMode
Compatibility
  • escaped and take_escaped now assert, rather than stop, on empty normal output
  • Some parsers used in seq(<tuple>) must now be mut
  • Stream::peek_token, Stream::peek_slice, Stream::peek_finish no longer return a clone of Stream
  • trait Locations functions have changed to improve parsing of lexed tokens
  • ParserError::append and FromExternalError::from_external_errors kind 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 name escaped
Features
  • Decoupled ErrMode from the core traits through new ModalError trait and ParserError 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 for ErrMode
Fixes
  • Borrow parsers in seq!(<tuple>) so they can be used multiple times
  • escaped and take_escaped now assert, rather than stop, on empty normal 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 with binary::bits parsers
  • escaped can now have separate types for normal and escaped parsers
Documentation
  • Modernized reference examples

v0.6.26

Compare Source

Compatibility
  • Deprecate ParserError::from_error_kind in favor of ParserError::from_input
  • Deprecate InputError::new in favor of InputError::at
  • Deprecate ErrorKind
    • If used as an error, consider EmptyError
    • For ParserError::append, just add an #[allow(deprecated)]
Features
  • Add EmptyError which is like () but compatible with Parser::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

Compare Source

Compatibility
  • Deprecated PResult in favor of ModalResult: v0.7 will make ErrMode optional and PResult will no longer be descriptive enough
  • Deprecate IResult in favor of PResult<(I, O)>
Documentation
  • Update comparison with nom
Fixes
  • Ensure we append errors in repeat(_).fold(1..)

v0.6.24

Compare Source

Fixes
  • Add back in winnow::Located which was removed by accident

v0.6.23

Compare Source

Compatibility
  • stream::Located is deprecated in favor of stream::LocatingSlice
  • combnator::rest is deprecated in favor of token::rest
  • combnator::rest_len is deprecated in favor of token::rest_len
  • combinator::<Struct> have mostly been deprecated in favor of combinator::impls::<Struct>
  • unpeek is deprecated
Features
  • Added repeat().try_fold() and repeat().verify_fold()

v0.6.22

Compare Source

Fixes
  • Respect is_partial in take_till

v0.6.21

Compare Source

Performance
  • More inlining
Documentation
  • Clarify roles of peek and Parser::parse_peek
  • Provide more context for people coming from nom

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻️ Rebasing: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this MR and you won't be reminded about this update again.


  • If you want to rebase/retry this MR, check this box

This MR has been generated by Renovate Bot.

Merge request reports

Loading