3 ms·
Taking a mutable slice is extremely common for exactly this reason. Even in the standard library, which can allocate. We added some convenient functions later,
by steveklabnik 6y ago
Taking a mutable slice is extremely common for exactly this reason. Even in the standard library, which can allocate. We added some convenient functions later, but it's a pretty standard practice.