3 ms·
The syntactic differences between this Rust example and Java are pretty minimal. Types come after identifiers in Rust instead of before them, as in Java, and th
by weberc2 9y ago
The syntactic differences between this Rust example and Java are pretty minimal. Types come after identifiers in Rust instead of before them, as in Java, and the namespace delimiter is `::` instead of `.`. The bits that are likely to hurt understanding pertain to memory management (borrowing, cloning, dereferencing, boxing, ref-counting, etc).
Besides conflating memory-management with syntax, this could also be made more readable by writing idiomatic Rust: use type inference in your `let` statement, fix your indentation on the last line, etc.