heap-array

nameheap-array
created_at2023-08-14 22:01:08.967564
updated_at2023-12-30 11:52:29.17469
downloads271
descriptionAn Implementation of a variable length array, with its main benefit over `Vec` is taking up less space
homepage
repositoryhttps://github.com/NightMare-Vortex/heap-array
max_upload_size
id944519

documentation

readme

# HeapArray An Implementation of a variable length array, with its main benefit over `Vec` is taking up less space as `HeapArray` is represented as (pointer, len) while Vec is a (pointer, len, capacity) and is meant as a replacement for `Box<[T]>` nice to have: compatible with serde # Example ```rust use heap_array::{heap_array, HeapArray}; fn main() { let arr = heap_array![1, 2, 5, 8]; assert_eq!(arr[0], 1); assert_eq!(arr[1], 2); assert_eq!(arr[2], 5); assert_eq!(arr[3], 8); assert_eq!(arr.len(), 4); let arr = HeapArray::from_fn(10, |i| i); assert_eq!(*arr, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) } ```
Commit count: 18

cargo fmt