union

Function union 

Source
pub fn union<T: Clone + Eq + Hash>(a: &[T], b: &[T]) -> Vec<T>
Expand description

Returns elements that are in either a or b (or both).

The order is: all elements from a, then elements from b not in a.

ยงExample

use d3rs::array::union;

let a = vec![1, 2, 3];
let b = vec![3, 4, 5];
assert_eq!(union(&a, &b), vec![1, 2, 3, 4, 5]);