Skip to content

Commit

Permalink
feat: Upgrade to winnow 0.5.19 and switch from newly deprecated funct…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
VorpalBlade committed Nov 4, 2023
1 parent adb59e7 commit 3a4ad9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ rustc_version_runtime = "0.3.0"
strum = { version = "0.25.0", features = ["derive"] }
thiserror = "1.0.50"
which = { version = "5.0.0", default-features = false }
winnow = "0.5.18"
winnow = "0.5.19"

[dev-dependencies]
pretty_assertions = "1.4.0"
6 changes: 3 additions & 3 deletions src/config/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use winnow::combinator::alt;
use winnow::combinator::delimited;
use winnow::combinator::opt;
use winnow::combinator::preceded;
use winnow::combinator::separated0;
use winnow::combinator::separated;
use winnow::error::StrContext;
use winnow::prelude::*;
use winnow::token::take_till0;
Expand Down Expand Up @@ -69,7 +69,7 @@ pub(super) fn parse_config(i: &mut &str) -> PResult<Vec<Directive>> {
"".map(|_| Directive::WS)
.context(StrContext::Label("whitespace")), // Blank lines
);
(separated0(alt(alternatives), newline), opt(newline))
(separated(0.., alt(alternatives), newline), opt(newline))
.map(|(val, _)| val)
.parse_next(i)
}
Expand Down Expand Up @@ -167,7 +167,7 @@ fn transform(i: &mut &str) -> PResult<Directive> {
matcher_transform,
space1,
take_till1([' ', '\r', '\n']),
opt(preceded(space1, separated0(transform_arg, space1))),
opt(preceded(space1, separated(0.., transform_arg, space1))),
)
.map(|(_, _, pattern, _, transform, args)| {
Directive::Transform(pattern, transform.to_owned(), args.unwrap_or_default())
Expand Down

0 comments on commit 3a4ad9f

Please sign in to comment.