This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 87fdf35
authored
Rollup merge of rust-lang#65222 - Lucretiel:fold_self, r=kodrAus
Proposal: `fold_self` and `try_fold_self` for Iterators
This pull request proposes & implements two new methods on Iterators: `fold_self` and `try_fold_self`. These are variants of `fold` and `try_fold` that use the first element in the iterator as the initial accumulator.
Let me know if a public feature like this requires an RFC, or if this pull request is sufficient as place for discussion.1 file changed
+39
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2005 | 2005 | | |
2006 | 2006 | | |
2007 | 2007 | | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
2008 | 2045 | | |
2009 | 2046 | | |
2010 | 2047 | | |
| |||
2497 | 2534 | | |
2498 | 2535 | | |
2499 | 2536 | | |
2500 | | - | |
| 2537 | + | |
2501 | 2538 | | |
2502 | 2539 | | |
2503 | 2540 | | |
| |||
2561 | 2598 | | |
2562 | 2599 | | |
2563 | 2600 | | |
2564 | | - | |
| 2601 | + | |
2565 | 2602 | | |
2566 | 2603 | | |
2567 | 2604 | | |
| |||
3214 | 3251 | | |
3215 | 3252 | | |
3216 | 3253 | | |
3217 | | - | |
3218 | | - | |
3219 | | - | |
3220 | | - | |
3221 | | - | |
3222 | | - | |
3223 | | - | |
3224 | | - | |
3225 | | - | |
3226 | | - | |
3227 | | - | |
3228 | | - | |
3229 | | - | |
3230 | | - | |
3231 | 3254 | | |
3232 | 3255 | | |
3233 | 3256 | | |
| |||
0 commit comments