Skip to content

Commit 86ea47f

Browse files
committed
Upgrade to Winnow 0.4
1 parent b3f0418 commit 86ea47f

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

Cargo.lock

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

gix-actor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ gix-date = { version = "^0.7.1", path = "../gix-date" }
2323
thiserror = "1.0.38"
2424
btoi = "0.4.2"
2525
bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"]}
26-
winnow = { version = "0.3", features = ["simd"] }
26+
winnow = { version = "0.4", features = ["simd"] }
2727
itoa = "1.0.1"
2828
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
2929

gix-actor/src/signature/decode.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub(crate) mod function {
3131
.and_then(|(i, v)| {
3232
btoi::<SecondsSinceUnixEpoch>(v)
3333
.map(|v| (i, v))
34-
.map_err(|_| winnow::error::ErrMode::from_error_kind(i, winnow::error::ErrorKind::MapRes))
34+
.map_err(|_| winnow::error::ErrMode::from_error_kind(i, winnow::error::ErrorKind::Verify))
3535
})
3636
})
3737
.context("<timestamp>"),
@@ -46,7 +46,7 @@ pub(crate) mod function {
4646
.and_then(|(i, v)| {
4747
btoi::<OffsetInSeconds>(v)
4848
.map(|v| (i, v))
49-
.map_err(|_| winnow::error::ErrMode::from_error_kind(i, winnow::error::ErrorKind::MapRes))
49+
.map_err(|_| winnow::error::ErrMode::from_error_kind(i, winnow::error::ErrorKind::Verify))
5050
})
5151
})
5252
.context("HH"),
@@ -56,7 +56,7 @@ pub(crate) mod function {
5656
.and_then(|(i, v)| {
5757
btoi::<OffsetInSeconds>(v)
5858
.map(|v| (i, v))
59-
.map_err(|_| winnow::error::ErrMode::from_error_kind(i, winnow::error::ErrorKind::MapRes))
59+
.map_err(|_| winnow::error::ErrMode::from_error_kind(i, winnow::error::ErrorKind::Verify))
6060
})
6161
})
6262
.context("MM"),
@@ -188,7 +188,7 @@ mod tests {
188188
.map_err(to_bstr_err)
189189
.expect_err("parse fails as > is missing")
190190
.to_string(),
191-
"Parse error:\nTakeUntil at: 12345 -1215\nin section '<email>', at: 12345 -1215\nin section '<name> <<email>>', at: hello < 12345 -1215\nin section '<name> <<email>> <timestamp> <+|-><HHMM>', at: hello < 12345 -1215\n"
191+
"Parse error:\nSlice at: 12345 -1215\nin section '<email>', at: 12345 -1215\nin section '<name> <<email>>', at: hello < 12345 -1215\nin section '<name> <<email>> <timestamp> <+|-><HHMM>', at: hello < 12345 -1215\n"
192192
);
193193
}
194194

@@ -199,7 +199,7 @@ mod tests {
199199
.map_err(to_bstr_err)
200200
.expect_err("parse fails as > is missing")
201201
.to_string(),
202-
"Parse error:\nMapRes at: -1215\nin section '<timestamp>', at: abc -1215\nin section '<name> <<email>> <timestamp> <+|-><HHMM>', at: hello <> abc -1215\n"
202+
"Parse error:\nVerify at: -1215\nin section '<timestamp>', at: abc -1215\nin section '<name> <<email>> <timestamp> <+|-><HHMM>', at: hello <> abc -1215\n"
203203
);
204204
}
205205
}

gix-object/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ btoi = "0.4.2"
3838
itoa = "1.0.1"
3939
thiserror = "1.0.34"
4040
bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"] }
41-
winnow = { version = "0.3", features = ["simd"] }
41+
winnow = { version = "0.4", features = ["simd"] }
4242
smallvec = { version = "1.4.0", features = ["write"] }
4343
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
4444

gix-object/src/tag/decode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn git_tag<'a, E: ParseError<&'a [u8]> + ContextError<&'a [u8]>>(i: &'a [u8]
1919
.context("type <object kind>")
2020
.parse_next(i)?;
2121
let kind = crate::Kind::from_bytes(kind)
22-
.map_err(|_| winnow::error::ErrMode::from_error_kind(i, winnow::error::ErrorKind::MapRes))?;
22+
.map_err(|_| winnow::error::ErrMode::from_error_kind(i, winnow::error::ErrorKind::Verify))?;
2323

2424
let (i, tag_version) = (|i| parse::header_field(i, b"tag", take_while1(|b| b != NL[0])))
2525
.context("tag <version>")

gix-object/src/tag/ref_iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl<'a> TagRefIter<'a> {
7979
.context("type <object kind>")
8080
.parse_next(i)?;
8181
let kind = Kind::from_bytes(kind)
82-
.map_err(|_| winnow::error::ErrMode::from_error_kind(i, winnow::error::ErrorKind::MapRes))?;
82+
.map_err(|_| winnow::error::ErrMode::from_error_kind(i, winnow::error::ErrorKind::Verify))?;
8383
*state = Name;
8484
(i, Token::TargetKind(kind))
8585
}

gix-object/src/tree/ref_iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl<'a> Iterator for TreeRefIter<'a> {
7171
#[allow(clippy::unit_arg)]
7272
Some(Err(winnow::error::ErrMode::from_error_kind(
7373
&[] as &[u8],
74-
winnow::error::ErrorKind::MapRes,
74+
winnow::error::ErrorKind::Verify,
7575
)
7676
.into()))
7777
}
@@ -163,7 +163,7 @@ mod decode {
163163
pub fn entry<'a, E: ParseError<&'a [u8]>>(i: &'a [u8]) -> IResult<&[u8], EntryRef<'_>, E> {
164164
let (i, mode) = terminated(take_while_m_n(5, 6, AsChar::is_dec_digit), SPACE).parse_next(i)?;
165165
let mode = tree::EntryMode::try_from(mode)
166-
.map_err(|invalid| winnow::error::ErrMode::from_error_kind(invalid, winnow::error::ErrorKind::MapRes))?;
166+
.map_err(|invalid| winnow::error::ErrMode::from_error_kind(invalid, winnow::error::ErrorKind::Verify))?;
167167
let (i, filename) = terminated(take_while1(|b| b != NULL[0]), NULL).parse_next(i)?;
168168
let (i, oid) = take(20u8).parse_next(i)?; // TODO: make this compatible with other hash lengths
169169

gix-ref/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ gix-lock = { version = "^7.0.0", path = "../gix-lock" }
3131
gix-tempfile = { version = "^7.0.0", default-features = false, path = "../gix-tempfile" }
3232

3333
thiserror = "1.0.34"
34-
winnow = { version = "0.3", features = ["simd"] }
34+
winnow = { version = "0.4", features = ["simd"] }
3535
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
3636

3737
# packed refs

gix-ref/src/store/file/log/line.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub mod decode {
148148
if let Some(first) = message.first() {
149149
if !first.is_ascii_whitespace() {
150150
return Err(
151-
winnow::error::ErrMode::from_error_kind(i, winnow::error::ErrorKind::MapRes).map(|err: E| {
151+
winnow::error::ErrMode::from_error_kind(i, winnow::error::ErrorKind::Verify).map(|err: E| {
152152
err.add_context(i, "log message must be separated from signature with whitespace")
153153
}),
154154
);

tests/tools/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ gix-worktree = "0.17.0"
2121
gix-fs = { version = "^0.4.1", path = "../../gix-fs" }
2222
gix-tempfile = { version = "^7.0.0", default-features = false, features = ["signals"], path = "../../gix-tempfile" }
2323

24-
winnow = { version = "0.3", features = ["simd"] }
24+
winnow = { version = "0.4", features = ["simd"] }
2525
fastrand = "2.0.0"
2626
bstr = { version = "1.5.0", default-features = false }
2727
crc = "3.0.0"

0 commit comments

Comments
 (0)