Over the weekend, I was working on a personal Rust project when I ran into an excessive memory usage problem. After an evening of trial and error, I found a workaround to fix the memory usage, but I still didn’t understand how the issue was even possible, so I then spent another evening digging through the source code of the Rust standard library to understand the root cause.
I actually came in here to post just that. It’s something that, while I’ve vaguely known, is not something I typically remember to do - I’m usually returning or collecting Vecs all over. I shall be now diligent & intentional from now on.