If you want to update the value of a String, it is more efficient to recycle the existing allocation with clear and write* instead of reallocating with format! โป๏ธ
#Divan shows that the method with format! has one allocation while the other one doesn't ๐
@mo8it I wonder what would happen if the updated string is longer than the old one, for the above example, if you take the number 144 to be randomised u32 (0 to u32::MAX) , that would be more general use case and accurate benchmark too
While implementing dependency injection in #rust using its trait system, we rediscovered the โimplied boundsโ problem which was already in discussion from 2014 but not yet implemented.
Done some refactoring on my little #rust project. The "?" operator for handling Result errors is particularly elegant and allowed me to untangle some nested match/if statements.