From 057e704e5f909420f596f7bbed41915b38753642 Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Sun, 8 Dec 2024 14:24:14 +0100 Subject: [PATCH] clippy --- src/bytes/complete.rs | 4 ++-- src/internal.rs | 24 ++++++++++++------------ src/traits.rs | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/bytes/complete.rs b/src/bytes/complete.rs index a34897ef..780483a8 100644 --- a/src/bytes/complete.rs +++ b/src/bytes/complete.rs @@ -415,13 +415,13 @@ where /// assert_eq!(esc(r#"12\"34;"#), Ok((";", r#"12\"34"#))); /// ``` /// -pub fn escaped<'a, I: 'a, Error, F, G>( +pub fn escaped<'a, I, Error, F, G>( normal: F, control_char: char, escapable: G, ) -> impl FnMut(I) -> IResult where - I: Clone + crate::traits::Offset + Input, + I: Clone + crate::traits::Offset + Input + 'a, ::Item: crate::traits::AsChar, F: Parser, G: Parser, diff --git a/src/internal.rs b/src/internal.rs index e8c7f0d8..94ed7c85 100644 --- a/src/internal.rs +++ b/src/internal.rs @@ -27,9 +27,9 @@ pub trait Finish { /// *warning*: if the result is `Err(Err::Incomplete(_))`, this method will panic. /// - "complete" parsers: It will not be an issue, `Incomplete` is never used /// - "streaming" parsers: `Incomplete` will be returned if there's not enough data - /// for the parser to decide, and you should gather more data before parsing again. - /// Once the parser returns either `Ok(_)`, `Err(Err::Error(_))` or `Err(Err::Failure(_))`, - /// you can get out of the parsing loop and call `finish()` on the parser's result + /// for the parser to decide, and you should gather more data before parsing again. + /// Once the parser returns either `Ok(_)`, `Err(Err::Error(_))` or `Err(Err::Failure(_))`, + /// you can get out of the parsing loop and call `finish()` on the parser's result fn finish(self) -> Result<(I, O), E>; } @@ -83,14 +83,14 @@ impl Needed { /// It has three cases: /// /// * `Incomplete` indicates that more data is needed to decide. The `Needed` enum -/// can contain how many additional bytes are necessary. If you are sure your parser -/// is working on full data, you can wrap your parser with the `complete` combinator -/// to transform that case in `Error` +/// can contain how many additional bytes are necessary. If you are sure your parser +/// is working on full data, you can wrap your parser with the `complete` combinator +/// to transform that case in `Error` /// * `Error` means some parser did not succeed, but another one might (as an example, -/// when testing different branches of an `alt` combinator) +/// when testing different branches of an `alt` combinator) /// * `Failure` indicates an unrecoverable error. For example, when a prefix has been -/// recognised and the next parser has been confirmed, if that parser fails, then the -/// entire process fails; there are no more parsers to try. +/// recognised and the next parser has been confirmed, if that parser fails, then the +/// entire process fails; there are no more parsers to try. /// /// Distinguishing `Failure` this from `Error` is only relevant inside the parser's code. For /// external consumers, both mean that parsing failed. @@ -316,10 +316,10 @@ impl Mode for Check { /// Parser result type /// /// * `Ok` branch: a tuple of the remaining input data, and the output value. -/// The output value is of the `O` type if the output mode was [Emit], and `()` -/// if the mode was [Check] +/// The output value is of the `O` type if the output mode was [Emit], and `()` +/// if the mode was [Check] /// * `Err` branch: an error of the `E` type if the erroor mode was [Emit], and `()` -/// if the mode was [Check] +/// if the mode was [Check] pub type PResult = Result< (I, <::Output as Mode>::Output), Err::Error as Mode>::Output>, diff --git a/src/traits.rs b/src/traits.rs index b9b70ed6..1313953e 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -1533,7 +1533,7 @@ impl NomRange for RangeFrom { } fn bounded_iter(&self) -> Self::Bounded { - 0..core::usize::MAX + 0..usize::MAX } } @@ -1616,7 +1616,7 @@ impl NomRange for RangeFull { } fn bounded_iter(&self) -> Self::Bounded { - 0..core::usize::MAX + 0..usize::MAX } }