Can this be `let len = modifications.len(); if partials.len() > len { partials[len] = x; } else { partials.push(x) }`, which removes the need to store `i`?