Function rs_utils::array::snd_default [] [src]

pub fn snd_default<A, B, N, M>(
    from: &GenericArray<(A, B), N>
) -> GenericArray<B, M> where
    B: Clone + Default,
    N: ArrayLength<(A, B)>,
    M: ArrayLength<B>, 

Create a new array from the second elements of an array of pairs or the default if the destination array length is longer than the input array length.

use generic_array::GenericArray;
use typenum::consts::*;
let xs : [(u8, f32); 2]        = [(5, 1.0), (100, -1.0)];
let ys : GenericArray <f32, U3> = snd_default (&xs.into());
assert_eq!(ys.as_slice(), [1.0, -1.0, 0.0]);