Just published a follow up post on Rust for Java developers. On ownership & borrowing… let me know what you think!

https://wcgw.dev/posts/2023/rusty-java-2/

3rd installment on the way already…

Rust for Java developers, part 2

Where did we get so far? In the first installment of this now series of Rust for Java developers, we saw some basic syntax, some pattern matching, briefly touched on enum and, most importantly, tried to reason about where the data in our programs resides. When we quickly tried to save a line of code, we inadvertently changed the scope of an important resource because of RAII and the borrow checker gave us an error when we tried compiling the code: