Skip to content

Commit 754769b

Browse files
committed
chore: Upgrade to Winnow 0.7
1 parent 9415da2 commit 754769b

File tree

5 files changed

+10
-20
lines changed

5 files changed

+10
-20
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/toml_edit/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ unbounded = []
4141

4242
[dependencies]
4343
indexmap = { version = "2.3.0", features = ["std"] }
44-
winnow = { version = "0.6.26", optional = true }
44+
winnow = { version = "0.7.0", optional = true }
4545
serde = { version = "1.0.145", optional = true }
4646
kstring = { version = "2.0.0", features = ["max_inline"], optional = true }
4747
toml_datetime = { version = "0.6.8", path = "../toml_datetime" }

crates/toml_edit/src/parser/datetime.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,9 @@ fn full_date_(input: &mut Input<'_>) -> ModalResult<Date> {
7474
};
7575
if max_days_in_month < day {
7676
input.reset(&day_start);
77-
#[expect(deprecated)]
78-
return Err(winnow::error::ErrMode::from_external_error(
79-
input,
80-
winnow::error::ErrorKind::Verify,
81-
CustomError::OutOfRange,
82-
)
83-
.cut());
77+
return Err(
78+
winnow::error::ErrMode::from_external_error(input, CustomError::OutOfRange).cut(),
79+
);
8480
}
8581

8682
Ok(Date { year, month, day })

crates/toml_edit/src/parser/mod.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,10 @@ pub(crate) mod prelude {
139139
mut parser: impl ModalParser<Input<'b>, O, ContextError>,
140140
) -> impl ModalParser<Input<'b>, O, ContextError> {
141141
move |input: &mut Input<'b>| {
142-
input.state.enter().map_err(|err| {
143-
#[allow(deprecated)]
144-
winnow::error::ErrMode::from_external_error(
145-
input,
146-
winnow::error::ErrorKind::Eof,
147-
err,
148-
)
149-
.cut()
150-
})?;
142+
input
143+
.state
144+
.enter()
145+
.map_err(|err| winnow::error::ErrMode::from_external_error(input, err).cut())?;
151146
let result = parser.parse_next(input);
152147
input.state.exit();
153148
result

crates/toml_edit/src/parser/trivia.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use winnow::combinator::peek;
99
use winnow::combinator::repeat;
1010
use winnow::combinator::terminated;
1111
use winnow::prelude::*;
12-
use winnow::stream::Stream as _;
1312
use winnow::token::any;
1413
use winnow::token::one_of;
1514
use winnow::token::take_while;

0 commit comments

Comments
 (0)