Re:What Rust Can Do That Other Languages Can't
by erikdesjardins on Monday February 06, 2017 @09:33AM
(#13579698)
The original example does not return a mutable reference; in Rust you must explicitly opt in to mutability. Compare [1] and [2].
[1]: https://play.rust-lang.org/?gist=78e7af18c6fc7d37d9df96be63a...
[2]: https://play.rust-lang.org/?gist=2072a18b674685f20c9d1504a88...
Nevertheless, a better solution was pointed out in an answer on the blog and by humanrebar.