Commit 2e82d11
committed
Rollup merge of rust-lang#58730 - timvermeulen:internal_iteration, r=scottmcm
Have all methods of Filter and FilterMap use internal iteration
This PR changes `Filter::{next, next_back, count}` and `FilterMap::{next, next_back}` to all use internal iteration. The `next` and `next_back` methods are changed to directly forward to `try_for_each` and `try_rfold` respectively, using `Result` as the `Try` type. I think that's okay? Alternatively, I could change their implementations to use `LoopState` instead if there's any benefit in doing so.
r? @scottmcm2 files changed
+37
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
| 684 | + | |
690 | 685 | | |
691 | 686 | | |
692 | 687 | | |
| |||
707 | 702 | | |
708 | 703 | | |
709 | 704 | | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
716 | 708 | | |
717 | 709 | | |
718 | 710 | | |
| |||
746 | 738 | | |
747 | 739 | | |
748 | 740 | | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
| 741 | + | |
755 | 742 | | |
756 | 743 | | |
757 | 744 | | |
| |||
820 | 807 | | |
821 | 808 | | |
822 | 809 | | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
| 810 | + | |
829 | 811 | | |
830 | 812 | | |
831 | 813 | | |
| |||
863 | 845 | | |
864 | 846 | | |
865 | 847 | | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
| 848 | + | |
872 | 849 | | |
873 | 850 | | |
874 | 851 | | |
| |||
0 commit comments