Skip to content

Commit

Permalink
Add check for len of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
coolreader18 committed Feb 7, 2024
1 parent c8ab421 commit d8e9d1c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2372,6 +2372,7 @@ pub trait ParallelIterator: Sized + Send {
/// ```
fn collect_vec_list(self) -> LinkedList<Vec<Self::Item>> {
match self.opt_len() {
Some(0) => LinkedList::new(),
Some(len) => {
// Pseudo-specialization. See impl of ParallelExtend for Vec for more details.
let mut v = Vec::new();
Expand Down

0 comments on commit d8e9d1c

Please sign in to comment.