[][src]Function array_tools::join

pub fn join<T, A: FixedSizeArray<T>, LEFT: FixedSizeArray<T>, RIGHT: FixedSizeArray<T>>(
    left: LEFT,
    right: RIGHT
) -> A

A function to join arrays.

Takes two arrays as arguments and returns array containing elements of both.

Panics

Panics if output array length is not equal to sum of input arrays' lengths.

Note

Currently it panics if output array has incompatible length. In future this behavior most certainly will be changed to perform this check at compile time.

Examples

use array_tools;

let left = [1u64, 2];
let right = [3u64, 4, 5, 6, 7, 8];
let joined: [u64; 8] = array_tools::join(left, right);
assert_eq!(joined, [1u64, 2, 3, 4, 5, 6, 7, 8]);