From 9918693037dce8aa4bb6f08741b6812923486c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 Jun 2024 11:26:03 +0200 Subject: Merging upstream version 1.76.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/gix-protocol/src/remote_progress.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'vendor/gix-protocol/src/remote_progress.rs') 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 { - 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 { fn next_optional_percentage(i: &mut &[u8]) -> PResult, ()> { 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, ()> { } fn next_optional_number(i: &mut &[u8]) -> PResult, ()> { - 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, ()> { - 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)?; -- cgit v1.2.3