From a0411d6c6f03057d13e7282cc64071a1b5976beb Mon Sep 17 00:00:00 2001 From: Philippe-Cholet <44676486+Philippe-Cholet@users.noreply.github.com> Date: Thu, 25 Jan 2024 14:03:24 +0100 Subject: [PATCH] `CombinationsWithReplacement`: use a boxed slice internally --- src/combinations_with_replacement.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/combinations_with_replacement.rs b/src/combinations_with_replacement.rs index 88d858b5f..ee3497849 100644 --- a/src/combinations_with_replacement.rs +++ b/src/combinations_with_replacement.rs @@ -1,3 +1,4 @@ +use alloc::boxed::Box; use alloc::vec::Vec; use std::fmt; use std::iter::FusedIterator; @@ -16,7 +17,7 @@ where I: Iterator, I::Item: Clone, { - indices: Vec, + indices: Box<[usize]>, pool: LazyBuffer, first: bool, } @@ -46,7 +47,7 @@ where I: Iterator, I::Item: Clone, { - let indices: Vec = alloc::vec![0; k]; + let indices = alloc::vec![0; k].into_boxed_slice(); let pool: LazyBuffer = LazyBuffer::new(iter); CombinationsWithReplacement {