indexmap/rayon/mod.rs
1#![cfg_attr(docsrs, doc(cfg(feature = "rayon")))]
2
3use rayon::prelude::*;
4
5use alloc::collections::LinkedList;
6use alloc::vec::Vec;
7
8pub mod map;
9pub mod set;
10
11// This form of intermediate collection is also how Rayon collects `HashMap`.
12// Note that the order will also be preserved!
13fn collect<I: IntoParallelIterator>(iter: I) -> LinkedList<Vec<I::Item>> {
14 iter.into_par_iter().collect_vec_list()
15}