One could also write the Go version using channels [1] and the Rust version in a more functional way [2], but overall the code is quite straightforward in both languages.<p>Only thing I don't like about the Rust version is, that the error message is still a bit cryptic:<p>```
Cannot borrow data mutably in a captured outer variable in an `Fn` closure.
```<p>But the important part is that Rust prevents a data race at compile time, which is nice.<p>[1]: <a href="https://github.com/hello-rust/show/pull/46" rel="nofollow">https://github.com/hello-rust/show/pull/46</a>
[2]: <a href="https://github.com/hello-rust/show/pull/45" rel="nofollow">https://github.com/hello-rust/show/pull/45</a>