summaryrefslogtreecommitdiffstats
path: root/vendor/gix-protocol/src/remote_progress.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /vendor/gix-protocol/src/remote_progress.rs
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-protocol/src/remote_progress.rs')
-rw-r--r--vendor/gix-protocol/src/remote_progress.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/vendor/gix-protocol/src/remote_progress.rs b/vendor/gix-protocol/src/remote_progress.rs
index b516a06bf..af12cd35e 100644
--- a/vendor/gix-protocol/src/remote_progress.rs
+++ b/vendor/gix-protocol/src/remote_progress.rs
@@ -2,10 +2,9 @@ use std::convert::TryFrom;
use bstr::ByteSlice;
use winnow::{
- combinator::opt,
- combinator::{preceded, terminated},
+ combinator::{opt, preceded, terminated},
prelude::*,
- token::{tag, take_till0, take_till1},
+ token::{tag, take_till},
};
/// The information usually found in remote progress messages as sent by a git server during
@@ -75,7 +74,7 @@ impl<'a> RemoteProgress<'a> {
}
fn parse_number(i: &mut &[u8]) -> PResult<usize, ()> {
- take_till0(|c: u8| !c.is_ascii_digit())
+ take_till(0.., |c: u8| !c.is_ascii_digit())
.try_map(btoi::btoi)
.parse_next(i)
}
@@ -83,7 +82,7 @@ fn parse_number(i: &mut &[u8]) -> PResult<usize, ()> {
fn next_optional_percentage(i: &mut &[u8]) -> PResult<Option<u32>, ()> {
opt(terminated(
preceded(
- take_till0(|c: u8| c.is_ascii_digit()),
+ take_till(0.., |c: u8| c.is_ascii_digit()),
parse_number.try_map(u32::try_from),
),
tag(b"%"),
@@ -92,11 +91,11 @@ fn next_optional_percentage(i: &mut &[u8]) -> PResult<Option<u32>, ()> {
}
fn next_optional_number(i: &mut &[u8]) -> PResult<Option<usize>, ()> {
- opt(preceded(take_till0(|c: u8| c.is_ascii_digit()), parse_number)).parse_next(i)
+ opt(preceded(take_till(0.., |c: u8| c.is_ascii_digit()), parse_number)).parse_next(i)
}
fn parse_progress<'i>(line: &mut &'i [u8]) -> PResult<RemoteProgress<'i>, ()> {
- let action = take_till1(|c| c == b':').parse_next(line)?;
+ let action = take_till(1.., |c| c == b':').parse_next(line)?;
let percent = next_optional_percentage.parse_next(line)?;
let step = next_optional_number.parse_next(line)?;
let max = next_optional_number.parse_next(line)?;