2 ms·
Idk. Did you see the "Buffer reuse" section of this blog post? [1] Kudos to that guy for solving the puzzle, but I really don't want to use a special trick to
by srcreigh 8mo ago
Idk. Did you see the "Buffer reuse" section of this blog post? [1]
Kudos to that guy for solving the puzzle, but I really don't want to use a special trick to get the compiler to let me reuse a buffer in a for loop.
[1]: https://davidlattimore.github.io/posts/2025/09/02/rustforge-wild-performance-tricks.html https://davidlattimore.github.io/posts/2025/09/02/rustforge-...
- ycombinatrix 8mo agoI've never seen `split_off_mut` but I do use `split_at_mut` quite often to solve similar issues. Using a slice instead of using a Vec directly also tends to greatly simplify things. I also don't fully understand the buffer reuse example. Why would you want to store references to a string after the string ceases to exist?