1

LRG-01: The essence of Rust

 2 years ago
source link: https://www.youtube.com/watch?v=LDlBTbO8oQ4
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
0:00 / 39:27

LRG-01: The essence of Rust

403 views
Oct 8, 2021

In this episode you will learn about what makes Rust different, its essence if you so will, and we will dive in to trying out mutable and shared borrows as one manifestations of Rusts ownership system.

Links: https://github.com/Byron/gitoxide https://github.com/Byron/learning-rus...

Show lessShow more

6 Comments

Sort by
default-user=s48-c-k-c0x00ffffff-no-rj
Add a public comment...
19:00 the reason you are not getting errors for 42 and "gitoxide" is because they are both Copy types of i32 and &str, which pretty much means they can be bit copied. To properly test ownership, you need to use a non-Copy types, like String::from("gitoxide") or Box::new(42). The reason is that String and Box owns resource (a.k.a. memory), so can't be trivially copied. You can clone() those values though, which does a deep copy of the struct and it's value

Read more 2 weeks ago

26:00 what's derefferencing and why is it needed here?! 🤔

2 weeks ago


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK