hashbrown 0.16.1

A Rust port of Google's SwissTable hash map
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use alloc::collections::LinkedList;
use alloc::vec::Vec;

use rayon::iter::{IntoParallelIterator, ParallelIterator};

/// Helper for collecting parallel iterators to an intermediary
#[allow(clippy::linkedlist)] // yes, we need linked list here for efficient appending!
pub(super) fn collect<I: IntoParallelIterator>(iter: I) -> (LinkedList<Vec<I::Item>>, usize) {
    let list = iter.into_par_iter().collect_vec_list();

    let len = list.iter().map(Vec::len).sum();
    (list, len)
}