News for hackers. Stuff that matters.
Re:Ask HN: How do I understand Rust? by _nalply on Saturday January 28, 2017 @03:01AM (#13505433)
Instead of using unsafe code, I would use RefCell first: «a mutable memory location with dynamically checked borrow rules»

https://doc.rust-lang.org/std/cell/struct.RefCell.html

Using clone() also often helps. clone() has an overhead since you copy bytes, but sometimes you need to get something working right first, then optimise.

There are other tricks if the borrow checker interferes.

There are no comments on this comment yet.