rust-itertools / itertools

Extra iterator adaptors, iterator methods, free functions, and macros.
https://docs.rs/itertools/
Apache License 2.0
2.72k stars 309 forks source link

Specialize `ExactlyOneError::fold` #826

Closed Philippe-Cholet closed 10 months ago

Philippe-Cholet commented 10 months ago

Related to #755

cargo bench --bench specializations "exactly_one_error/fold"

exactly_one_error/fold  [568.69 ns 570.74 ns 572.99 ns]
exactly_one_error/fold  [268.29 ns 268.52 ns 268.78 ns]
                        [-52.687% -52.402% -52.141%]

EDIT: Apparently, I previously forgot the specialization test.