const-slice

Crates.ioconst-slice
lib.rsconst-slice
version0.1.0
sourcesrc
created_at2022-10-17 13:46:04.963858
updated_at2022-10-17 13:46:04.963858
descriptionworking with slices in compile-time constants
homepage
repository
max_upload_size
id690171
size7,792
radiish (soqb)

documentation

README

const-slice

Compile-time constant variants of several slice types over dynamically allocated types, implemented as slices over a fixed-capacity array (controlled by const generics).

The types in this crate will panic at compile-time if they would exceed the size of their array (currently produces a very unhelpful error - see #51999)

Examples

const FIRST: &str = "mary had a";
const SECOND: &str = " little lamb.";

const BOTH: ConstString<32> = ConstString::from_str(FIRST).with_str(SECOND);

assert_eq!(BOTH, ConstString::from_str("mary had a little lamb."));
Commit count: 0

cargo fmt