bool_traits

Crates.iobool_traits
lib.rsbool_traits
version0.1.1
sourcesrc
created_at2024-04-07 20:34:16.060972
updated_at2024-04-07 20:43:20.62926
descriptionUse boolean expressions as trait bounds.
homepage
repository
max_upload_size
id1199519
size3,774
(melvdlin)

documentation

https://docs.rs/bool_traits

README

bool_traits

bool_traits

Use boolean expressions as trait bounds.

Examples

#![feature(generic_const_exprs)]

use bool_traits::*;

fn create_small_u8_array<const N: usize>() -> [u8; N]
    where
        (): True<{ N <= 4 }>,
{
    [0; N]
}
// this compiles:
let array = create_small_u8_array::<3 > ();
// this does not:
let array = create_small_u8_array::<5 > ();
Commit count: 0

cargo fmt