boxchop

Crates.ioboxchop
lib.rsboxchop
version0.1.0
sourcesrc
created_at2020-08-20 22:15:08.349667
updated_at2020-08-20 22:15:08.349667
descriptionA crate for creating boxed slices
homepagehttps://github.com/clavin/boxchop
repositoryhttps://github.com/clavin/boxchop
max_upload_size
id278938
size8,294
Calvin (clavin)

documentation

README

boxchop

Documentation | View on libs.rs

A tiny library for creating boxed slices Box<[T]>.

let nums = boxchop::new_with(5, |x| x + 1);

assert_eq!(
    nums,
    Box::from([1, 2, 3, 4, 5]),
);

⚠️ This was created before I found the new_uninit nightly feature. The fundamental itch this crate scratches will eventually be part of the standard library: see Box::new_uninit_slice and Box::assume_init.

Commit count: 4

cargo fmt