Commit 05e9c74
committed
Apply clippy to doctest
taiki-e/github-actions@96af4dc
```
error: redundant closure
--> src/lib.rs:150:49
|
150 | Box::new(self.child.iter().flat_map(|c| c.method())) as Box<dyn Iterator<Item = _>>
| ^^^^^^^^^^^^^^ help: replace the closure with the method itself: `Type::method`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
= note: `-D clippy::redundant-closure-for-method-calls` implied by `-D clippy::pedantic`
= help: to override `-D clippy::pedantic` add `#[allow(clippy::redundant_closure_for_method_calls)]`
error: this loop never actually loops
--> src/lib.rs:475:14
|
475 | 1 => loop {
| ______________^
476 | | panic!()
477 | | },
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#never_loop
= note: `-D clippy::never-loop` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::never_loop)]`
error: this `.fold` can be written more succinctly using another method
--> src/lib.rs:538:10
|
538 | iter.fold(0, |sum, x| sum + x)
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold
= note: `-D clippy::unnecessary-fold` implied by `-D clippy::all`
= help: to override `-D clippy::all` add `#[allow(clippy::unnecessary_fold)]`
```1 parent babf7a7 commit 05e9c74
1 file changed
+9
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
468 | 469 | | |
469 | 470 | | |
470 | 471 | | |
| 472 | + | |
471 | 473 | | |
472 | 474 | | |
473 | 475 | | |
| |||
527 | 529 | | |
528 | 530 | | |
529 | 531 | | |
| 532 | + | |
530 | 533 | | |
531 | 534 | | |
532 | 535 | | |
| |||
870 | 873 | | |
871 | 874 | | |
872 | 875 | | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
877 | 882 | | |
878 | 883 | | |
879 | 884 | | |
| |||
0 commit comments