[][src]Trait core_extensions::collection_traits::IntoArray

pub trait IntoArray {
    type Array;
    fn into_array(self) -> Self::Array;

Converts a fixed length collection to an array.


This trait is only implemented for built-in/core types
if the "colltraits" cargo feature is enabled.


This example is not tested
use core_extensions::collection_traits::IntoArray;

assert_eq!( (2,).into_array(), [2] );
assert_eq!( (2,3).into_array(), [2,3] );
assert_eq!( (2,3,5).into_array(), [2,3,5] );
assert_eq!( (2,3,5,8).into_array(), [2,3,5,8] );

Associated Types

type Array

The type of the array of the same length as the tuple

Loading content...

Required methods

fn into_array(self) -> Self::Array

Converts the tuple to an array..

Loading content...


Loading content...