diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/winnow/benches | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/winnow/benches')
-rw-r--r-- | vendor/winnow/benches/contains_token.rs | 20 | ||||
-rw-r--r-- | vendor/winnow/benches/number.rs | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/vendor/winnow/benches/contains_token.rs b/vendor/winnow/benches/contains_token.rs index 67397baf7..a35c1b2b1 100644 --- a/vendor/winnow/benches/contains_token.rs +++ b/vendor/winnow/benches/contains_token.rs @@ -1,10 +1,10 @@ use criterion::black_box; -use winnow::branch::alt; -use winnow::bytes::take_till1; -use winnow::bytes::take_while1; -use winnow::multi::many0; +use winnow::combinator::alt; +use winnow::combinator::repeat; use winnow::prelude::*; +use winnow::token::take_till1; +use winnow::token::take_while; fn contains_token(c: &mut criterion::Criterion) { let data = [ @@ -55,22 +55,22 @@ fn contains_token(c: &mut criterion::Criterion) { fn parser_str(input: &str) -> IResult<&str, usize> { let contains = "0123456789"; - many0(alt((take_while1(contains), take_till1(contains)))).parse_next(input) + repeat(0.., alt((take_while(1.., contains), take_till1(contains)))).parse_next(input) } fn parser_slice(input: &str) -> IResult<&str, usize> { let contains = &['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'][..]; - many0(alt((take_while1(contains), take_till1(contains)))).parse_next(input) + repeat(0.., alt((take_while(1.., contains), take_till1(contains)))).parse_next(input) } fn parser_array(input: &str) -> IResult<&str, usize> { let contains = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - many0(alt((take_while1(contains), take_till1(contains)))).parse_next(input) + repeat(0.., alt((take_while(1.., contains), take_till1(contains)))).parse_next(input) } fn parser_tuple(input: &str) -> IResult<&str, usize> { let contains = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); - many0(alt((take_while1(contains), take_till1(contains)))).parse_next(input) + repeat(0.., alt((take_while(1.., contains), take_till1(contains)))).parse_next(input) } fn parser_closure_or(input: &str) -> IResult<&str, usize> { @@ -86,12 +86,12 @@ fn parser_closure_or(input: &str) -> IResult<&str, usize> { || c == '8' || c == '9' }; - many0(alt((take_while1(contains), take_till1(contains)))).parse_next(input) + repeat(0.., alt((take_while(1.., contains), take_till1(contains)))).parse_next(input) } fn parser_closure_matches(input: &str) -> IResult<&str, usize> { let contains = |c: char| matches!(c, '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'); - many0(alt((take_while1(contains), take_till1(contains)))).parse_next(input) + repeat(0.., alt((take_while(1.., contains), take_till1(contains)))).parse_next(input) } const CONTIGUOUS: &str = "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"; diff --git a/vendor/winnow/benches/number.rs b/vendor/winnow/benches/number.rs index e801c8c41..b6c6fac57 100644 --- a/vendor/winnow/benches/number.rs +++ b/vendor/winnow/benches/number.rs @@ -3,11 +3,11 @@ extern crate criterion; use criterion::Criterion; -use winnow::character::float; +use winnow::ascii::float; +use winnow::binary::be_u64; use winnow::error::ErrMode; use winnow::error::Error; use winnow::error::ErrorKind; -use winnow::number::be_u64; use winnow::prelude::*; use winnow::stream::ParseSlice; |