From ef24de24a82fe681581cc130f342363c47c0969a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 7 Jun 2024 07:48:48 +0200 Subject: Merging upstream version 1.75.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/winnow-0.4.7/src/bits.rs | 71 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 vendor/winnow-0.4.7/src/bits.rs (limited to 'vendor/winnow-0.4.7/src/bits.rs') diff --git a/vendor/winnow-0.4.7/src/bits.rs b/vendor/winnow-0.4.7/src/bits.rs new file mode 100644 index 000000000..6b4981f30 --- /dev/null +++ b/vendor/winnow-0.4.7/src/bits.rs @@ -0,0 +1,71 @@ +//! Deprecated, see [`binary::bits`] +#![deprecated(since = "0.4.2", note = "Replaced with `binary::bits`")] + +use crate::binary; +use crate::error::{ErrorConvert, ParseError}; +use crate::lib::std::ops::{AddAssign, Shl, Shr}; +use crate::stream::{AsBytes, Stream, StreamIsPartial, ToUsize}; +use crate::{IResult, Parser}; + +/// Deprecated, replaced with [`binary::bits::bits`] +#[deprecated(since = "0.4.2", note = "Replaced with `binary::bits::bits`")] +#[inline(always)] +pub fn bits(parser: P) -> impl Parser +where + E1: ParseError<(I, usize)> + ErrorConvert, + E2: ParseError, + I: Stream, + P: Parser<(I, usize), O, E1>, +{ + binary::bits::bits(parser) +} + +/// Deprecated, replaced with [`binary::bits::bytes`] +#[deprecated(since = "0.4.2", note = "Replaced with `binary::bits::bytes`")] +#[inline(always)] +pub fn bytes(parser: P) -> impl Parser<(I, usize), O, E2> +where + E1: ParseError + ErrorConvert, + E2: ParseError<(I, usize)>, + I: Stream, + P: Parser, +{ + binary::bits::bytes(parser) +} + +/// Deprecated, replaced with [`binary::bits::take`] +#[deprecated(since = "0.4.2", note = "Replaced with `binary::bits::take`")] +#[inline(always)] +pub fn take>(count: C) -> impl Parser<(I, usize), O, E> +where + I: Stream + AsBytes + StreamIsPartial, + C: ToUsize, + O: From + AddAssign + Shl + Shr, +{ + binary::bits::take(count) +} + +/// Deprecated, replaced with [`binary::bits::tag`] +#[deprecated(since = "0.4.2", note = "Replaced with `binary::bits::tag`")] +#[inline(always)] +pub fn tag>( + pattern: O, + count: C, +) -> impl Parser<(I, usize), O, E> +where + I: Stream + AsBytes + StreamIsPartial, + C: ToUsize, + O: From + AddAssign + Shl + Shr + PartialEq, +{ + binary::bits::tag(pattern, count) +} + +/// Deprecated, replaced with [`binary::bits::bool`] +#[deprecated(since = "0.4.2", note = "Replaced with `binary::bits::bool`")] +#[inline(always)] +pub fn bool>(input: (I, usize)) -> IResult<(I, usize), bool, E> +where + I: Stream + AsBytes + StreamIsPartial, +{ + binary::bits::bool(input) +} -- cgit v1.2.3