Skip to content

Instantly share code, notes, and snippets.

@kevinfiol
Last active July 22, 2024 01:12
Show Gist options
  • Save kevinfiol/14f9806363a0fd2d5d53cabba0aa4422 to your computer and use it in GitHub Desktop.
Save kevinfiol/14f9806363a0fd2d5d53cabba0aa4422 to your computer and use it in GitHub Desktop.
Let's Get Rusty

2. Guessing Game

https://play.rust-lang.org/?version=beta&mode=debug&edition=2021&gist=600acd485b214c7e28bd35fe44872399

3. Common Programming Concepts in Rust

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f6d221ac7551364d04ed84f701406e12

4. Understanding Ownership

Copying, cloning, heap/stack: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=32252bcc07597a79cff3a3602b8465ab

Ownership and Functions: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a9a25c7c5eaa703f9c36667a5696c01f

References: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=91e2dbcfa1976800d96c263fca2f807c

References 2 (Dangling Reference): https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=2b1b0b9ca0abebde874b7e22814df385

Rules of References

  1. at any given time, you can have either one mutable reference, or any number of immutable references
  2. references must be valid

5. Structs

Simple Struct Examples + Tuple Structs: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=e0d6ae219a88c4adda6e3de8d68c59e6

Structs, Derive, Methods, impl: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a65227e12849b5f81793098758a627cc

6. Enums

Enums pt1: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=64b1827de0daa08aa889c80df4962827

Option, Some Enums: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=ff8378dad0deb5990676d298f2dc81be

If let syntax: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b24706e324cb287de6ddcd71dc47beb6

8. Collections

Vectors pt 1: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=062b39c64c851e5e199f0b309edd1188

Vectors and borrowing: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1bb6259dc19bb9dd9dd01b7498c2e5b0

Vectors and for loops: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=21c901f1da9536996f38647f2148af47

Strings: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=377fa082e0bcc46de46c1518020c0f66

Hash Maps: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b5574d71156868253b3860ee71e8fd26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment