3 ms·
Awesome :). Something else to keep in mind that while it's nice to have the borrow-checker validate everything it's okay to step around it if you've got a case
by vvanders 9y ago
Awesome :).
Something else to keep in mind that while it's nice to have the borrow-checker validate everything it's okay to step around it if you've got a case that's gnarly and you know is valid. I've had some C callback stuff where I run into that occasionally, I can't encode the lifetime semantics to the calling function so I have to side-step it.
In that case things like RefCell(which are separate from (A)Rc/Box) are a great "escape hatch".
Obviously you should try and keep it to a minimum but don't let it be a complete roadblock.