to_list
Mojo function 🡭
to_list
fn def to_list[size: Int, T: Copyable & Deinitable](data: Array[T, size]) -> List[T]Copy a fixed-size Array into a List.
Copies the underlying buffer in a single Span.copy_from rather than
element-by-element.
Parameters:
- size (
Int): The length ofdataand of the resulting list. - T (
Copyable & Deinitable): The element type.
Args:
- data (
Array[T, size]): The array to copy from.
Returns:
List[T]: A List[T] holding a copy of data.