Skip to content

Commit 03e4fc3

Browse files
committed
style: Make clippy happy
1 parent 1c31fde commit 03e4fc3

File tree

4 files changed

+12
-21
lines changed

4 files changed

+12
-21
lines changed

examples/iterator.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,7 @@ fn main() {
1515

1616
// `from_fn` (available from Rust 1.34) can create an iterator
1717
// from a closure
18-
let it = std::iter::from_fn(move || {
19-
match parser.parse_next(&mut data) {
20-
// when successful, a parser returns a tuple of
21-
// the remaining input and the output value.
22-
// So we replace the captured input data with the
23-
// remaining input, to be parsed on the next call
24-
Ok(o) => Some(o),
25-
_ => None,
26-
}
27-
});
18+
let it = std::iter::from_fn(move || parser.parse_next(&mut data).ok());
2819

2920
for value in it {
3021
println!("parser returned: {value}");

src/_topic/nom.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
//! 1. Resolve deprecation messages
3333
//! 1. Commit
3434
//! 1. Run `cargo add [email protected]`
35-
//! 1. Ensure everything compiles and tests pass, ignoring deprecation messages (see [migration
36-
//! notes](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md#050---2023-07-13))
35+
//! 1. Ensure everything compiles and tests pass, ignoring deprecation messages
36+
//! (see [migration notes](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md#050---2023-07-13))
3737
//! 1. Commit
3838
//! 1. Resolve deprecation messages
3939
//! 1. Commit

src/_tutorial/chapter_6.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
//! ```
1717
//! 1. We have to decide what to do about the "remainder" of the `input`.
1818
//! 2. The [`Result`] may not be compatible with the rest of the Rust ecosystem.
19-
//! Normally, Rust applications want errors that are `std::error::Error + Send + Sync + 'static`
20-
//! meaning:
21-
//! - They implement the [`std::error::Error`] trait
22-
//! - They can be sent across threads
23-
//! - They are safe to be referenced across threads
24-
//! - They do not borrow
19+
//! Normally, Rust applications want errors that are `std::error::Error + Send + Sync + 'static`
20+
//! meaning:
21+
//! - They implement the [`std::error::Error`] trait
22+
//! - They can be sent across threads
23+
//! - They are safe to be referenced across threads
24+
//! - They do not borrow
2525
//!
2626
//! winnow provides [`Parser::parse`] to help with this:
2727
//! - Ensures we hit [`eof`]

src/combinator/multi.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ where
161161
/// # Arguments
162162
/// * `init` A function returning the initial value.
163163
/// * `op` The function that combines a result of `f` with
164-
/// the current accumulator.
164+
/// the current accumulator.
165165
///
166166
/// <div class="warning">
167167
///
@@ -294,7 +294,7 @@ where
294294
/// # Arguments
295295
/// * `init` A function returning the initial value.
296296
/// * `op` The function that combines a result of `f` with
297-
/// the current accumulator.
297+
/// the current accumulator.
298298
///
299299
/// <div class="warning">
300300
///
@@ -370,7 +370,7 @@ where
370370
/// # Arguments
371371
/// * `init` A function returning the initial value.
372372
/// * `op` The function that combines a result of `f` with
373-
/// the current accumulator.
373+
/// the current accumulator.
374374
///
375375
/// <div class="warning">
376376
///

0 commit comments

Comments
 (0)