chore: Update winnow

This commit is contained in:
Ed Page 2024-02-12 20:22:47 -06:00
parent c4444bfc40
commit 2bf326a3c6
5 changed files with 11 additions and 11 deletions

4
Cargo.lock generated
View file

@ -1719,9 +1719,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
[[package]] [[package]]
name = "winnow" name = "winnow"
version = "0.5.36" version = "0.5.40"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "818ce546a11a9986bc24f93d0cdf38a8a1a400f1473ea8c82e59f6e0ffab9249" checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]

View file

@ -14,7 +14,7 @@ include.workspace = true
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
thiserror = "1.0" thiserror = "1.0"
winnow = "0.5.36" winnow = "0.5.40"
unicode-xid = "0.2.4" unicode-xid = "0.2.4"
once_cell = "1.19.0" once_cell = "1.19.0"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }

View file

@ -129,6 +129,7 @@ impl<'s> Iterator for Utf8Chunks<'s> {
} }
mod parser { mod parser {
use winnow::combinator::trace;
use winnow::combinator::*; use winnow::combinator::*;
use winnow::error::ParserError; use winnow::error::ParserError;
use winnow::prelude::*; use winnow::prelude::*;
@ -138,7 +139,6 @@ mod parser {
use winnow::stream::Stream; use winnow::stream::Stream;
use winnow::stream::StreamIsPartial; use winnow::stream::StreamIsPartial;
use winnow::token::*; use winnow::token::*;
use winnow::trace::trace;
pub(crate) fn next_identifier<T>(input: &mut T) -> PResult<<T as Stream>::Slice, ()> pub(crate) fn next_identifier<T>(input: &mut T) -> PResult<<T as Stream>::Slice, ()>
where where

View file

@ -16,7 +16,7 @@ parser = ["dep:winnow"]
flags = ["dep:enumflags2"] flags = ["dep:enumflags2"]
[dependencies] [dependencies]
winnow = { version = "0.5.36", optional = true } winnow = { version = "0.5.40", optional = true }
enumflags2 = { version = "0.7", optional = true } enumflags2 = { version = "0.7", optional = true }
[package.metadata.docs.rs] [package.metadata.docs.rs]

View file

@ -1,5 +1,5 @@
use winnow::combinator::trace;
use winnow::prelude::*; use winnow::prelude::*;
use winnow::trace::trace;
use crate::*; use crate::*;
@ -69,13 +69,13 @@ impl Cluster {
let header = ( let header = (
"#", "#",
winnow::ascii::space0, winnow::ascii::space0,
winnow::ascii::not_line_ending, winnow::ascii::till_line_ending,
winnow::ascii::line_ending, winnow::ascii::line_ending,
); );
let note = winnow::combinator::preceded( let note = winnow::combinator::preceded(
("##", winnow::ascii::space0), ("##", winnow::ascii::space0),
winnow::combinator::terminated( winnow::combinator::terminated(
winnow::ascii::not_line_ending, winnow::ascii::till_line_ending,
winnow::ascii::line_ending, winnow::ascii::line_ending,
), ),
); );
@ -170,7 +170,7 @@ impl Entry {
let comment = winnow::combinator::opt(( let comment = winnow::combinator::opt((
comment_sep, comment_sep,
winnow::ascii::space1, winnow::ascii::space1,
winnow::ascii::not_line_ending, winnow::ascii::till_line_ending,
)) ))
.parse_next(input)?; .parse_next(input)?;
@ -200,7 +200,7 @@ impl Entry {
winnow::combinator::opt((winnow::ascii::space1, "--")), winnow::combinator::opt((winnow::ascii::space1, "--")),
winnow::combinator::opt(( winnow::combinator::opt((
winnow::ascii::space1, winnow::ascii::space1,
winnow::token::take_till0(('\n', '\r', '#')), winnow::token::take_till(0.., ('\n', '\r', '#')),
)), )),
) )
.parse_next(input)?; .parse_next(input)?;
@ -343,7 +343,7 @@ impl Variant {
fn word(input: &mut &str) -> PResult<String, ()> { fn word(input: &mut &str) -> PResult<String, ()> {
trace("word", move |input: &mut &str| { trace("word", move |input: &mut &str| {
winnow::token::take_till1(|item: char| item.is_ascii_whitespace()) winnow::token::take_till(1.., |item: char| item.is_ascii_whitespace())
.map(|s: &str| s.to_owned().replace('_', " ")) .map(|s: &str| s.to_owned().replace('_', " "))
.parse_next(input) .parse_next(input)
}) })