A general method exists for dilating and undilating any type and any value of D. The general method uses the constant functions defined in const_generation.rs, so it should - in theory - be optimised as much as the hand written methods. However, this needs to be confirmed.
This should be a useful reference:
https://medium.com/journey-to-rust/viewing-assembly-for-rust-function-d4870baad941
A general method exists for dilating and undilating any type and any value of D. The general method uses the constant functions defined in const_generation.rs, so it should - in theory - be optimised as much as the hand written methods. However, this needs to be confirmed.
This should be a useful reference:
https://medium.com/journey-to-rust/viewing-assembly-for-rust-function-d4870baad941