smallest-uint

Given an unsigned type-level integer, provides access to the smallest primitive unsigned integer type ([u8], [u16], etc.) that can represent the integer’s value (or all values less than that value).

This is mainly useful for minimizing memory usage when building data structures.

This crate depends only on [core], so it can be used in no_std environments.

Example

```rust use smallest_uint::{SmallestUIntFor, SmallestUIntUpTo}; use std::any::TypeId; use typenum::U65536;

asserteq!(TypeId::of::>(), TypeId::of::()); asserteq!(TypeId::of::>(), TypeId::of::()); ```

Crate features

If the feature "u128" (enabled by default) is disabled, this crate will not use the [u128] type.