orx-parallel 4.0.0

Performant parallel computations with an expressive iterator API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use alloc::string::{String, ToString};
use alloc::vec::Vec;

pub fn inputs_opt(n: usize, error_idx: Option<usize>) -> Vec<Option<String>> {
    let error_idx = error_idx.unwrap_or(usize::MAX);
    (0..n)
        .map(|i| match i == error_idx {
            true => None,
            false => Some(i.to_string()),
        })
        .collect()
}

pub fn inputs(n: usize) -> Vec<String> {
    (0..n).map(|i| i.to_string()).collect()
}