From 03aba955ecb3d83961aa73005bf6f9a0b2c70dd3 Mon Sep 17 00:00:00 2001 From: Nathan West Date: Fri, 1 Sep 2023 15:27:06 -0400 Subject: [PATCH] `add` and `mul` now use a `[T, T]` array instead of chained iter::once --- src/iter/product.rs | 2 +- src/iter/sum.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iter/product.rs b/src/iter/product.rs index a3d0727f9..e081be06b 100644 --- a/src/iter/product.rs +++ b/src/iter/product.rs @@ -13,7 +13,7 @@ where } fn mul(left: T, right: T) -> T { - iter::once(left).chain(iter::once(right)).product() + [left, right].into_iter().product() } struct ProductConsumer { diff --git a/src/iter/sum.rs b/src/iter/sum.rs index a73e0bf3d..ddae810f9 100644 --- a/src/iter/sum.rs +++ b/src/iter/sum.rs @@ -13,7 +13,7 @@ where } fn add(left: T, right: T) -> T { - iter::once(left).chain(iter::once(right)).sum() + [left, right].into_iter().sum() } struct SumConsumer {