core: fix a typo in levdistance
auto merge of #5471 : erickt/rust/incoming, r=bstrie

I made a typo in `str::levdistance` in my str pull request. This fixes it.
Build up the result of fmt! in a buffer instead of a vector
Removing some unused imports
Pass the fmt! buffer to each conversion method

Achieves a little more speedup and avoids allocations around some strings in
conv_str