Crates.io | unzip-array-of-tuple |
lib.rs | unzip-array-of-tuple |
version | 0.1.0 |
source | src |
created_at | 2023-02-24 20:42:59.777475 |
updated_at | 2023-02-24 20:42:59.777475 |
description | This package currently provides one function that takes in an array containing tuples of two types; the function then returns two arrays, the first containing all the first elements of the tuples, and the second array containing the second elements of the tuples. This functionality is available in iterators through unzip, but unzip can only return collections which implement Extend; which primitive arrays do not. Therefore, unzip works fine for Vec or other dynamic types, but not for simple, beautiful arrays, with lengths known at compiletime. My implementation is hopefully quite efficient, as it just moves data around, without using too much costly abstractions like std::array::from_fn. This crate has 4 tests that I think cover basically everything; still it could be unsound.. |
homepage | https://github.com/kallehed/unzip-array-of-tuple |
repository | https://github.com/kallehed/unzip-array-of-tuple |
max_upload_size | |
id | 793919 |
size | 6,124 |
This package currently provides one function that takes in an array containing tuples of two types; the function then returns two arrays, the first containing all the first elements of the tuples, and the second array containing the second elements of the tuples. This functionality is available in iterators through unzip, but unzip can only return collections which implement Extend; which primitive arrays do not. Therefore, unzip works fine for Vec or other dynamic types, but not for simple, beautiful arrays, with lengths known at compiletime. My implementation is hopefully quite efficient, as it just moves data around, without using too much costly abstractions like std::array::from_fn. This crate has 4 tests that I think cover basically everything; still it could be unsound..