Skip to content

Commit abcfb65

Browse files
committed
upgrade to winnow 0.5.24
Fix deprecations while at it - these would show up during installation as well.
1 parent fd31228 commit abcfb65

File tree

13 files changed

+28
-27
lines changed

13 files changed

+28
-27
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.

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.8.0", 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.5.14", features = ["simd"] }
26+
winnow = { version = "0.5.24", features = ["simd"] }
2727
itoa = "1.0.1"
2828
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
2929

gix-config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ gix-sec = { version = "^0.10.0", path = "../gix-sec" }
2424
gix-ref = { version = "^0.38.0", path = "../gix-ref" }
2525
gix-glob = { version = "^0.14.0", path = "../gix-glob" }
2626

27-
winnow = { version = "0.5.14", features = ["simd"] }
27+
winnow = { version = "0.5.24", features = ["simd"] }
2828
memchr = "2"
2929
thiserror = "1.0.26"
3030
unicode-bom = "2.0.2"

gix-config/src/parse/nom/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use winnow::{
66
error::{ErrorKind, InputError as NomError, ParserError as _},
77
prelude::*,
88
stream::{Offset as _, Stream as _},
9-
token::{one_of, take_till0, take_while},
9+
token::{one_of, take_till, take_while},
1010
};
1111

1212
use crate::parse::{error::ParseNode, section, Comment, Error, Event};
@@ -82,7 +82,7 @@ fn newlines_from(input: &[u8], start: winnow::stream::Checkpoint<&[u8]>) -> usiz
8282
fn comment<'i>(i: &mut &'i [u8]) -> PResult<Comment<'i>, NomError<&'i [u8]>> {
8383
(
8484
one_of([';', '#']),
85-
take_till0(|c| c == b'\n').map(|text: &[u8]| Cow::Borrowed(text.as_bstr())),
85+
take_till(0.., |c| c == b'\n').map(|text: &[u8]| Cow::Borrowed(text.as_bstr())),
8686
)
8787
.map(|(tag, text)| Comment { tag, text })
8888
.parse_next(i)

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.5.14", features = ["simd"] }
41+
winnow = { version = "0.5.24", 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/commit/decode.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use winnow::{
55
combinator::{alt, eof, opt, preceded, repeat, rest, terminated},
66
error::{AddContext, ParserError, StrContext},
77
prelude::*,
8-
token::take_till1,
8+
token::take_till,
99
};
1010

1111
use crate::{parse, parse::NL, BStr, ByteSlice, CommitRef};
@@ -42,14 +42,15 @@ pub fn commit<'a, E: ParserError<&'a [u8]> + AddContext<&'a [u8], StrContext>>(
4242
.context(StrContext::Expected("author <signature>".into())),
4343
(|i: &mut _| parse::header_field(i, b"committer", parse::signature))
4444
.context(StrContext::Expected("committer <signature>".into())),
45-
opt(|i: &mut _| parse::header_field(i, b"encoding", take_till1(NL)))
45+
opt(|i: &mut _| parse::header_field(i, b"encoding", take_till(1.., NL)))
4646
.context(StrContext::Expected("encoding <encoding>".into())),
4747
repeat(
4848
0..,
4949
alt((
5050
parse::any_header_field_multi_line.map(|(k, o)| (k.as_bstr(), Cow::Owned(o))),
5151
|i: &mut _| {
52-
parse::any_header_field(i, take_till1(NL)).map(|(k, o)| (k.as_bstr(), Cow::Borrowed(o.as_bstr())))
52+
parse::any_header_field(i, take_till(1.., NL))
53+
.map(|(k, o)| (k.as_bstr(), Cow::Borrowed(o.as_bstr())))
5354
},
5455
)),
5556
)

gix-object/src/commit/message/decode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use winnow::{
33
error::ParserError,
44
prelude::*,
55
stream::{Offset, Stream},
6-
token::take_till1,
6+
token::take_till,
77
};
88

99
use crate::bstr::{BStr, ByteSlice};
@@ -16,7 +16,7 @@ fn subject_and_body<'a, E: ParserError<&'a [u8]>>(i: &mut &'a [u8]) -> PResult<(
1616
let start_i = *i;
1717
let start = i.checkpoint();
1818
while !i.is_empty() {
19-
match take_till1::<_, _, E>(|c| c == b'\n' || c == b'\r').parse_next(i) {
19+
match take_till::<_, _, E>(1.., |c| c == b'\n' || c == b'\r').parse_next(i) {
2020
Ok(_) => {
2121
let consumed_bytes = i.offset_from(&start);
2222
match preceded((newline::<E>, newline::<E>), rest).parse_next(i) {

gix-object/src/commit/ref_iter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use winnow::{
66
combinator::{alt, eof, opt, terminated},
77
error::StrContext,
88
prelude::*,
9-
token::take_till1,
9+
token::take_till,
1010
};
1111

1212
use crate::{
@@ -214,7 +214,7 @@ impl<'a> CommitRefIter<'a> {
214214
}
215215
}
216216
Encoding => {
217-
let encoding = opt(|i: &mut _| parse::header_field(i, b"encoding", take_till1(NL)))
217+
let encoding = opt(|i: &mut _| parse::header_field(i, b"encoding", take_till(1.., NL)))
218218
.context(StrContext::Expected("encoding <encoding>".into()))
219219
.parse_next(input)?;
220220
*state = State::ExtraHeaders;
@@ -227,7 +227,7 @@ impl<'a> CommitRefIter<'a> {
227227
let extra_header = opt(alt((
228228
|i: &mut _| parse::any_header_field_multi_line(i).map(|(k, o)| (k.as_bstr(), Cow::Owned(o))),
229229
|i: &mut _| {
230-
parse::any_header_field(i, take_till1(NL))
230+
parse::any_header_field(i, take_till(1.., NL))
231231
.map(|(k, o)| (k.as_bstr(), Cow::Borrowed(o.as_bstr())))
232232
},
233233
)))

gix-object/src/parse.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use winnow::{
33
combinator::{preceded, repeat, terminated},
44
error::{AddContext, ParserError, StrContext},
55
prelude::*,
6-
token::{take_till1, take_until0, take_while},
6+
token::{take_till, take_until0, take_while},
77
Parser,
88
};
99

@@ -17,9 +17,9 @@ pub(crate) fn any_header_field_multi_line<'a, E: ParserError<&'a [u8]> + AddCont
1717
i: &mut &'a [u8],
1818
) -> PResult<(&'a [u8], BString), E> {
1919
(
20-
terminated(take_till1(SPACE_OR_NL), SPACE),
20+
terminated(take_till(1.., SPACE_OR_NL), SPACE),
2121
(
22-
take_till1(NL),
22+
take_till(1.., NL),
2323
NL,
2424
repeat(1.., terminated((SPACE, take_until0(NL)), NL)).map(|()| ()),
2525
)
@@ -52,7 +52,7 @@ pub(crate) fn any_header_field<'a, T, E: ParserError<&'a [u8]>>(
5252
i: &mut &'a [u8],
5353
parse_value: impl Parser<&'a [u8], T, E>,
5454
) -> PResult<(&'a [u8], T), E> {
55-
terminated((terminated(take_till1(SPACE_OR_NL), SPACE), parse_value), NL).parse_next(i)
55+
terminated((terminated(take_till(1.., SPACE_OR_NL), SPACE), parse_value), NL).parse_next(i)
5656
}
5757

5858
fn is_hex_digit_lc(b: u8) -> bool {

gix-protocol/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ gix-credentials = { version = "^0.21.0", path = "../gix-credentials" }
4949
thiserror = "1.0.32"
5050
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
5151
bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"] }
52-
winnow = { version = "0.5.14", features = ["simd"] }
52+
winnow = { version = "0.5.24", features = ["simd"] }
5353
btoi = "0.4.2"
5454

5555
# for async-client

0 commit comments

Comments
 (0)