Maybe I am mistaken, but could the below be reduced to just: `uint::bits - (size - 1).leading_zeros()`, since the subtraction cannot underflow due to the if-guard above.  That would save a conditional branch.