intersection
Returns the elements of a that also appear in b, in a’s order.
Duplicates in a are kept: only membership in b decides whether an element stays.
Import
Section titled “Import”Cargo feature array (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
a | &[T] | The first slice. |
b | &[T] | The second slice. |
Returns
Section titled “Returns”Vec<T>
