Crate same_types

Source
Expand description

Ensure that two types are the same, or fail with a compilation error.

use same_types::assert_same_types;

assert_same_types!(u32, u32, u32, u32);
use same_types::assert_same_types;

// Fails with the message:
// the trait `SameTypes` is not implemented for `(i32, u32)`
assert_same_types!(u32, u32, i32, u32);

Macros§

assert_same_types
Assert that two or more types are exactly the same. Compilation error otherwise.

Traits§

SameTypes
Helper trait for assert_same_types to tell if two types are exactly the same.