Control Flow - Part 4 of Idiomatic Rust in Simple Steps

preview_player
Показать описание
Programs execute one line after another. How can we change what line comes next?

Note: You're probably going to want to pause a few times during this video as some of the examples go by quite quickly.

Chapters:
00:00 Intro
00:48 Patterns
02:02 Blocks are Expressions
03:22 if - Branching
04:49 if - Pattern Matching
05:50 match
07:12 loop
08:46 while
09:33 for ... in ...
11:22 Homework
12:09 Next time

Additional Credits:
Main Music: Adorable Adventures by ElvGames and Peggusensei
Рекомендации по теме
Комментарии
Автор

Erratum:


I'm definitely going to make mistakes as I make these, I'll pin a comment with anything important. If you spot anything not mentioned here, let me know so I can add it! 🙏🏻

That shirt


Since I'm trying to list all my mistakes 😅

Float values in match


This is actually a really bad idea as floats should never be used for "exactly equals", and in fact is a deprecated feature of Rust causing a compilation warning.

Using floats with things like greater than or less than in match guards is fine

You can use integers and chars for exact value matches in match though.

FiosQuest
Автор

You should split this video to multiple parts. I feel like there are still a lot of use case of each expression with let or nested all of them together. It’s hard for rust beginners like me to keep up (even though I have 4 years in the industry) But amazing video🎉

deltav
Автор

Please include Yuki in the videos as well... 😊❤

es-