Skip to content

Commit

Permalink
chore: Upgrade to Winnow 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jan 30, 2025
1 parent 9415da2 commit 754769b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 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 crates/toml_edit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ unbounded = []

[dependencies]
indexmap = { version = "2.3.0", features = ["std"] }
winnow = { version = "0.6.26", optional = true }
winnow = { version = "0.7.0", optional = true }
serde = { version = "1.0.145", optional = true }
kstring = { version = "2.0.0", features = ["max_inline"], optional = true }
toml_datetime = { version = "0.6.8", path = "../toml_datetime" }
Expand Down
10 changes: 3 additions & 7 deletions crates/toml_edit/src/parser/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,9 @@ fn full_date_(input: &mut Input<'_>) -> ModalResult<Date> {
};
if max_days_in_month < day {
input.reset(&day_start);
#[expect(deprecated)]
return Err(winnow::error::ErrMode::from_external_error(
input,
winnow::error::ErrorKind::Verify,
CustomError::OutOfRange,
)
.cut());
return Err(
winnow::error::ErrMode::from_external_error(input, CustomError::OutOfRange).cut(),
);
}

Ok(Date { year, month, day })
Expand Down
13 changes: 4 additions & 9 deletions crates/toml_edit/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,10 @@ pub(crate) mod prelude {
mut parser: impl ModalParser<Input<'b>, O, ContextError>,
) -> impl ModalParser<Input<'b>, O, ContextError> {
move |input: &mut Input<'b>| {
input.state.enter().map_err(|err| {
#[allow(deprecated)]
winnow::error::ErrMode::from_external_error(
input,
winnow::error::ErrorKind::Eof,
err,
)
.cut()
})?;
input
.state
.enter()
.map_err(|err| winnow::error::ErrMode::from_external_error(input, err).cut())?;
let result = parser.parse_next(input);
input.state.exit();
result
Expand Down
1 change: 0 additions & 1 deletion crates/toml_edit/src/parser/trivia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use winnow::combinator::peek;
use winnow::combinator::repeat;
use winnow::combinator::terminated;
use winnow::prelude::*;
use winnow::stream::Stream as _;
use winnow::token::any;
use winnow::token::one_of;
use winnow::token::take_while;
Expand Down

0 comments on commit 754769b

Please sign in to comment.