2 ms·
> Also, I think str vs. String is usually confusing at first, regardless of your background. Yes, of course. Rust has some new concepts that will be confusing
by ibraheemdev 5y ago
> Also, I think str vs. String is usually confusing at first, regardless of your background.
Yes, of course. Rust has some new concepts that will be confusing at first, regardless of your background. You still have to understand Rust's destructors to understand that example. I didn't mean to say that it is impossible for Rubyists to learn Rust, or that C++ devs would understand Rust immediately.
Perhaps a better example:
fn foo() -> &usize {
let x = 50;
&x
}