2 ms·
Sorry, you are correct. I was thinking of situations like this: fn assign(a: &mut Bar, b: &Bar) { a.foo = b.foo; } assign(&mut a[0], &a[1]);
by IshKebab 7y ago
Sorry, you are correct. I was thinking of situations like this:
fn assign(a: &mut Bar, b: &Bar) {
a.foo = b.foo;
}
assign(&mut a[0], &a[1]);
Bit contrived - next time Rust stops me doing something simple I will note it down!
Again to be clear, I'm not saying that there's anything wrong with Rust here.
- steveklabnik 7y agoAh yeah, you can split_at_mut here, but you're right that that's an actual error. My bad!