Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Dec 8, 2024
1 parent 1fbf855 commit 057e704
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/bytes/complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<I, I, Error>
where
I: Clone + crate::traits::Offset + Input,
I: Clone + crate::traits::Offset + Input + 'a,
<I as Input>::Item: crate::traits::AsChar,
F: Parser<I, Error = Error>,
G: Parser<I, Error = Error>,
Expand Down
24 changes: 12 additions & 12 deletions src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ pub trait Finish<I, O, E> {
/// *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>;
}

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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<OM, I, O, E> = Result<
(I, <<OM as OutputMode>::Output as Mode>::Output<O>),
Err<E, <<OM as OutputMode>::Error as Mode>::Output<E>>,
Expand Down
4 changes: 2 additions & 2 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ impl NomRange<usize> for RangeFrom<usize> {
}

fn bounded_iter(&self) -> Self::Bounded {
0..core::usize::MAX
0..usize::MAX
}
}

Expand Down Expand Up @@ -1616,7 +1616,7 @@ impl NomRange<usize> for RangeFull {
}

fn bounded_iter(&self) -> Self::Bounded {
0..core::usize::MAX
0..usize::MAX
}
}

Expand Down

0 comments on commit 057e704

Please sign in to comment.