2 ms·
Rust wrapper types aren't like C++ typedef. If you just want an alias for the u8 type in Rust, you get the exact same performance: type Tiny = u8; The compile
by tialaramex 5y ago
Rust wrapper types aren't like C++ typedef. If you just want an alias for the u8 type in Rust, you get the exact same performance:
type Tiny = u8;
The compiler knows a "Tiny" is just a u8 anyway and exactly the same code is produced.
The wrapper type is a distinct type, which is why you'd want one because it can have different properties from whatever it's wrapping.