From cf6cbe581607376ae3d9552bc8e0e8778f27995d Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Thu, 19 Oct 2023 23:10:28 -0700 Subject: [PATCH] Simplify init code. --- src/merge_data.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/merge_data.rs b/src/merge_data.rs index 7203aee..97bb6e6 100644 --- a/src/merge_data.rs +++ b/src/merge_data.rs @@ -16,7 +16,8 @@ pub struct MergeDeferredDataSource { impl MergeDeferredDataSource { pub fn new(data_sources: Vec>) -> Self { assert!(!data_sources.is_empty()); - let infos = (0..data_sources.len()).map(|_| VecDeque::new()).collect(); + let mut infos = Vec::new(); + infos.resize_with(data_sources.len(), VecDeque::new); Self { data_sources, infos,