2 ms·
Actually in Rust you have a problem where you can't express partial access to a struct at a function level. This means that you can't put some code into a separ
by est31 7y ago
Actually in Rust you have a problem where you can't express partial access to a struct at a function level. This means that you can't put some code into a separate function right now, making use of closures/iterators harder. There are attempts to fix this ([1] [2]). If borrow checking is done on collections of objects instead, the problem can be tackled more easily I think.
[1]: https://github.com/rust-lang/rust/issues/53488 https://github.com/rust-lang/rust/issues/53488
[2]: http://smallcultfollowing.com/babysteps/blog/2018/04/16/rust-pattern-rooting-an-rc-handle/ http://smallcultfollowing.com/babysteps/blog/2018/04/16/rust...
- roca 7y agoThere's some friction there, but in practice it's easy to work around most of the time. I'm not sure extending the type system there is worth the weight.