diff --git a/src/parser/range.rs b/src/parser/range.rs index 7b53fe64..ff21d708 100644 --- a/src/parser/range.rs +++ b/src/parser/range.rs @@ -701,6 +701,48 @@ where [ .then_partial(|&mut len| take(len)) } } +#[derive(Copy, Clone)] +pub struct Offset
(usize, P); + +impl Parser for Offset
+where
+ Input: RangeStream,
+ P: Parser,
+{
+ type Output = O;
+ type PartialState = ();
+
+ #[inline]
+ fn parse_lazy(&mut self, input: &mut Input) -> ParseResult
+where
+ P: Parser,
+ Input: RangeStream,
+{
+ Offset(count, p)
+}
#[cfg(test)]
mod tests {
diff --git a/src/stream/buf_reader.rs b/src/stream/buf_reader.rs
index fa7b928b..04dbc3ed 100644
--- a/src/stream/buf_reader.rs
+++ b/src/stream/buf_reader.rs
@@ -8,11 +8,7 @@ use std::io::{self, BufRead, Read};
))]
use std::pin::Pin;
-#[cfg(any(
- feature = "futures-03",
- feature = "tokio-02",
- feature = "tokio-03"
-))]
+#[cfg(any(feature = "futures-03", feature = "tokio-02", feature = "tokio-03"))]
use std::mem::MaybeUninit;
#[cfg(feature = "futures-core-03")]
diff --git a/src/stream/decoder.rs b/src/stream/decoder.rs
index ad034f87..1bc96c39 100644
--- a/src/stream/decoder.rs
+++ b/src/stream/decoder.rs
@@ -136,7 +136,7 @@ impl Decoder {
impl Decoder
where
- C: ,
+ C:,
{
#[doc(hidden)]
pub fn __before_parse