Could this whole function be replaced by a call to `mem::uninit`? It seems like it should work, as you never inspect the key and value and you immediately overwrite the pointers. I'm not sure if there are any downsides, but it would make this simpler.