#vec #combination #values #give

combinations

This crate give you all the combinations of values in a vec

1 unstable release

0.1.0 Aug 1, 2019

#1688 in Data structures

Download history 114/week @ 2024-09-27 76/week @ 2024-10-04 72/week @ 2024-10-11 62/week @ 2024-10-18 56/week @ 2024-10-25 70/week @ 2024-11-01 39/week @ 2024-11-08 46/week @ 2024-11-15 74/week @ 2024-11-22 77/week @ 2024-11-29 117/week @ 2024-12-06 129/week @ 2024-12-13 37/week @ 2024-12-20 8/week @ 2024-12-27 63/week @ 2025-01-03 102/week @ 2025-01-10

213 downloads per month
Used in 4 crates (3 directly)

MIT/Apache

8KB
119 lines

Project Title

This crate give you all the combinations of values in a vec

Example

let actual: Vec<_> = Combinations::new(vec![1, 2, 2, 3, 4], 3).collect();
let expected = vec![
    vec![1, 2, 2],
    vec![1, 2, 3],
    vec![1, 2, 4],
    vec![1, 3, 4],
    vec![2, 2, 3],
    vec![2, 2, 4],
    vec![2, 3, 4],
];
assert!(actual == expected);

Contributing

Any contributions are welcomed.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.


lib.rs:

This crate give you all the combinations of values in a vec

No runtime deps