Write Idiomatic Rust with These Tips and Tricks

Channel:
Subscribers:
725,000
Published on ● Video Link: https://www.youtube.com/watch?v=Ty_JQEu-ncI



Duration: 7:43
6,086 views
175


Write idiomatic Rust with these actionable tips and tricks. I reviewed a calculator (parser + interpreter) written in Rust and found a few ways to make it better and faster.

0:00 wrap(unwrap())
0:13 if {true} else {false}
0:19 String → str slice
0:34 if let ... && ...: https://github.com/rust-lang/rfcs/blo...
1:45 .copy() → 'static
2:06 HashSet[str] → bit set
3:03 compiler tests
4:00 how to split big functions
4:48 shorten error code
5:01 assert!
5:37 returning &mut
6:03 multi match
6:16 converting errors
7:20 code review final thoughts

PUBLICATION PERMISSIONS:
Original video was published with the Creative Commons Attribution license (reuse allowed). Link: https://www.youtube.com/watch?v=w_LUixO3tpU







Tags:
rust
programming in rust
rust programming
rust tutorial