According to Godbolt¹, on x86_64 using binary and produces slightly better code than using subtraction. Readability of both is pretty much equivalent so might just as well use the shorter option. ¹ https://rust.godbolt.org/z/9jM3ejbMx |
||
|---|---|---|
| .. | ||
| convert.rs | ||
| decode.rs | ||
| methods.rs | ||
| mod.rs | ||