paholg / dimensioned

Compile-time dimensional analysis for various unit systems using Rust's type system.
https://crates.io/crates/dimensioned
MIT License
300 stars 23 forks source link

Replace transmutes with pointer casts (#52) #57

Closed adeschamps closed 6 years ago

adeschamps commented 6 years ago

Here's an option to get rid of the transmutes, based on the alternatives section of the docs. We cast a reference to a pointer, then cast to a different pointer type, and then use unsafe to cast that pointer back to a reference.