48 ms·
split_at_mut is for borrowed references. That's the case where I said it does work out of the box with fields, since you can take mutable references to disjoin
by comex 6y ago
split_at_mut is for borrowed references. That's the case where I said it does work out of the box with fields, since you can take mutable references to disjoint fields, and the borrow checker allows it without you having to do anything special. But if you want to take an owned pointer to an object and split it into owned pointers to its subcomponents (which only makes sense with Rc), I don't think the standard library has a way to do that for either fields or arrays.
- _bxg1 6y agoAh, that makes sense my mistake