Skimming through this, there are syntax errors (e.g. → instead of -> and ’ instead of ' in some function signatures), inconsistencies in code style, and a number of content errors (e.g. the content surrounding early return is still quite wrong and suggests a lack of understanding of the actual feature, expression-orientation; and the description of what &str is; and the description of Copy and copy semantics being simplified beyond what I would consider truth). Overall it’s a decent summary and most of the content seems correct, but be careful.
If you are more of an interactive learner I would recommend installing rust on your machine and then cloning the rustlings repo <a href="https://github.com/rust-lang/rustlings" rel="nofollow">https://github.com/rust-lang/rustlings</a>.<p>Rustlings is an interactive collection of rust exercises that are either incorrect or incomplete. The exercises are grouped into key concepts of rust and cross referenced with relevant chapters in the rust book <a href="https://doc.rust-lang.org/book/" rel="nofollow">https://doc.rust-lang.org/book/</a><p>The general flow is to open up the given chapter of the rust book for a set of exercises and hack away at them until they compile. It's a good way to quickly get an introduction to rust and its core features.
This seems like a fairly gentle introduction. I will definitely consider it as a starting point for more junior developers interested in touching our Rust code.<p>For those with more experience, Rust By Example walks through the same concepts in a more compact form that also lets you experiment with the code in your browser: <a href="https://doc.rust-lang.org/rust-by-example/index.html" rel="nofollow">https://doc.rust-lang.org/rust-by-example/index.html</a>
Example for skipping return keyword in case of early return is just wrong. It can be made to work if you have
if x > 0 { x } else { x + 1 } but then it isn't early return anymore.
See also, <a href="https://doc.rust-lang.org/book/title-page.html" rel="nofollow">https://doc.rust-lang.org/book/title-page.html</a>
I highly, highly recommend this crash course from Michael Snoyman: <a href="https://www.snoyman.com/blog/2018/10/introducing-rust-crash-course" rel="nofollow">https://www.snoyman.com/blog/2018/10/introducing-rust-crash-...</a>
Just heard an insightful (for an outsider) podcast episode on Rust with the folks behind much of the resources being shared here in this thread.<p>_An Introduction to Rust featuring Carol Nichols and Jake Goulding_, <a href="https://www.heroku.com/podcasts/codeish/34-an-introduction-to-rust" rel="nofollow">https://www.heroku.com/podcasts/codeish/34-an-introduction-t...</a>
Looks like it's down.<p>Webcache version - <a href="https://webcache.googleusercontent.com/search?q=cache:SHrbchRsRpQJ:https://www.softax.pl/blog/rust-lang-in-a-nutshell-1-introduction" rel="nofollow">https://webcache.googleusercontent.com/search?q=cache:SHrbch...</a>
<p><pre><code> let s1 ="hello world";
let s2 = s1; // copied – x1 is still valid
let x1 = 2;
let x2 = x1; // copied – x1 is still valid
println!("{} for the {}nd time!", s1, x1);
</code></pre>
Typo in first comment? s1 vs x1?
I'm increasingly intrigued by Rust. Can anyone recommend a good analysis / benchmarking of Rust compared to C/C++ code? Curious how it fares on a performance basis.