tuple_len

Github actions Gitlab CI

Get the number of elements in a tuple.

Usage

Add it to your dependencies:

toml [dependencies] tuple_len = "2.0"

```rust // The macro way, compute at compilation time asserteq!(tuplelen::tuple_len!(("hello", 5, 'c')), 3);

// The trait way use tuplelen::TupleLen; asserteq!(().len(), 0);

// The function way let tuple = (1,); asserteq!(tuplelen::len(&tuple), 1); ```