about summary refs log tree commit diff
path: root/src/libcore/iter/traits/accum.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-205/+0
2020-07-17Intra-doc for iter Sum and Product traitsLzu Tao-6/+6
2020-01-06Use Self instead of $typeLzu Tao-8/+8
2019-11-26Format libcore with rustfmtDavid Tolnay-10/+14
This commit applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in `outstanding_files`, the relevant commands were: $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018 $ rg libcore outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libcore.
2019-08-12Reduce the genericity of closures in the iterator traitsJosh Stone-4/+4
By default, closures inherit the generic parameters of their scope, including `Self`. However, in most cases, the closures used to implement iterators don't need to be generic on the iterator type, only its `Item` type. We can reduce this genericity by redirecting such closures through local functions. This does make the closures more cumbersome to write, but it will hopefully reduce duplication in their monomorphizations, as well as their related type lengths.
2019-07-29Use internal iteration in the Sum and Product impls of Result and OptionTim Vermeulen-5/+5
2019-07-27Refactoring use commun code between option, result and accumStargateur-135/+1
2019-06-23Fix meta-variable binding errors in macrosJulien Cretin-2/+2
The errors are either: - The meta-variable used in the right-hand side is not bound (or defined) in the left-hand side. - The meta-variable used in the right-hand side does not repeat with the same kleene operator as its binder in the left-hand side. Either it does not repeat enough, or it uses a different operator somewhere. This change should have no semantic impact.
2019-05-29Rollup merge of #58975 - jtdowney:iter_arith_traits_option, r=dtolnayMazdak Farrokhzad-0/+110
Implement `iter::Sum` and `iter::Product` for `Option` This is similar to the existing implementation for `Result`. It will take each item into the accumulator unless a `None` is returned. I based a lot of this on #38580. From that discussion it didn't seem like this addition would be too controversial or difficult. One thing I still don't understand is picking the values for the `stable` attribute. This is my first non-documentation PR for rust so I am open to any feedback on improvements.
2019-05-28Bump Sum and Product for Option<T> to 1.37David Tolnay-2/+2
2019-04-18libcore => 2018Taiki Endo-2/+2
2019-03-20Add improved doc example for Sum<Option<T>>John Downey-8/+5
2019-03-19Update stable attribute to be since 1.35.0Mazdak Farrokhzad-2/+2
Co-Authored-By: jtdowney <jdowney@gmail.com>
2019-03-06Implement `iter::Sum` and `iter::Product` for `Option`John Downey-0/+113
This is similar to the existing implementation for `Result`. It will take each item into the accumulator unless a `None` is returned.
2019-01-22Move Sum, Product to own moduleClar Fon-0/+225