Skip to content

Commit

Permalink
Upgrade to Winnow 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jan 31, 2025
1 parent 0e71412 commit fdc57e7
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 22 deletions.
29 changes: 19 additions & 10 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 gix-actor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bstr = { version = "1.3.0", default-features = false, features = [
"std",
"unicode",
] }
winnow = { version = "0.6.26", features = ["simd"] }
winnow = { version = "0.7.0", features = ["simd"] }
itoa = "1.0.1"
serde = { version = "1.0.114", optional = true, default-features = false, features = [
"derive",
Expand Down
2 changes: 1 addition & 1 deletion gix-actor/src/signature/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ mod tests {
.map_err(to_bstr_err)
.expect_err("parse fails as > is missing")
.to_string(),
"in fail at 'hello < 12345 -1215'\n 0: invalid Closing '>' not found at 'hello < 12345 -1215'\n 1: expected `<name> <<email>> <timestamp> <+|-><HHMM>` at 'hello < 12345 -1215'\n"
" at 'hello < 12345 -1215'\n 0: invalid Closing '>' not found at 'hello < 12345 -1215'\n 1: expected `<name> <<email>> <timestamp> <+|-><HHMM>` at 'hello < 12345 -1215'\n"
);
}

Expand Down
2 changes: 1 addition & 1 deletion gix-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ gix-sec = { version = "^0.10.11", path = "../gix-sec" }
gix-ref = { version = "^0.50.0", path = "../gix-ref" }
gix-glob = { version = "^0.18.0", path = "../gix-glob" }

winnow = { version = "0.6.26", features = ["simd"] }
winnow = { version = "0.7.0", features = ["simd"] }
memchr = "2"
thiserror = "2.0.0"
unicode-bom = { version = "2.0.3" }
Expand Down
9 changes: 6 additions & 3 deletions gix-config/src/parse/nom/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use std::borrow::Cow;
use bstr::{BStr, ByteSlice};
use winnow::{
combinator::{alt, delimited, opt, preceded, repeat},
error::{InputError as NomError, ParserError as _},
error::{ErrMode, InputError as NomError, ParserError as _},
prelude::*,
stream::{Offset as _, Stream as _},
stream::Offset as _,
token::{one_of, take_till, take_while},
};

Expand Down Expand Up @@ -133,7 +133,10 @@ fn section_header<'i>(i: &mut &'i [u8]) -> ModalResult<section::Header<'i>, NomE
// No spaces must be between section name and section start
let name = preceded('[', take_while(1.., is_section_char).map(bstr::ByteSlice::as_bstr)).parse_next(i)?;

if opt(one_of::<_, _, NomError<&[u8]>>(']')).parse_next(i)?.is_some() {
if opt(one_of::<_, _, ErrMode<NomError<&[u8]>>>(']'))
.parse_next(i)?
.is_some()
{
// Either section does not have a subsection or using deprecated
// subsection syntax at this point.
let header = match memchr::memrchr(b'.', name.as_bytes()) {
Expand Down
2 changes: 1 addition & 1 deletion gix-object/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bstr = { version = "1.3.0", default-features = false, features = [
"std",
"unicode",
] }
winnow = { version = "0.6.26", features = ["simd"] }
winnow = { version = "0.7.0", features = ["simd"] }
smallvec = { version = "1.4.0", features = ["write"] }
serde = { version = "1.0.114", optional = true, default-features = false, features = [
"derive",
Expand Down
1 change: 0 additions & 1 deletion gix-object/src/commit/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use winnow::{
combinator::{alt, eof, opt, preceded, repeat, terminated},
error::{AddContext, ParserError, StrContext},
prelude::*,
stream::Stream as _,
token::{rest, take_till},
};

Expand Down
2 changes: 1 addition & 1 deletion gix-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ bstr = { version = "1.3.0", default-features = false, features = [
"std",
"unicode",
] }
winnow = { version = "0.6.26", features = ["simd"] }
winnow = { version = "0.7.0", features = ["simd"] }

# for async-client
async-trait = { version = "0.1.51", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion gix-ref/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ gix-lock = { version = "^16.0.0", path = "../gix-lock" }
gix-tempfile = { version = "^16.0.0", default-features = false, path = "../gix-tempfile" }

thiserror = "2.0.0"
winnow = { version = "0.6.26", features = ["simd"] }
winnow = { version = "0.7.0", features = ["simd"] }
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] }

# packed refs
Expand Down
2 changes: 1 addition & 1 deletion gix-ref/src/store/packed/iter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use gix_object::bstr::{BString, ByteSlice};
use winnow::{combinator::preceded, prelude::*, stream::Stream as _, token::rest};
use winnow::{combinator::preceded, prelude::*, token::rest};

use crate::store_impl::{packed, packed::decode};

Expand Down
2 changes: 1 addition & 1 deletion tests/tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ gix-worktree = "0.34.0"
gix-fs = "0.11"
gix-tempfile = { version = "^14.0.0", default-features = false, features = ["signals"] }

winnow = { version = "0.6.26", features = ["simd"] }
winnow = { version = "0.7.0", features = ["simd"] }
fastrand = "2.0.0"
bstr = { version = "1.5.0", default-features = false }
crc = "3.0.0"
Expand Down

0 comments on commit fdc57e7

Please sign in to comment.