Rust Conditional Statements

  Рет қаралды 8,098

Doug Milford

Doug Milford

Күн бұрын

Пікірлер: 21
@alfieqashwa
@alfieqashwa 5 жыл бұрын
"the compiler is a wonderful tool but it can't read your mind" at 8:05 :D
@haI9k
@haI9k 4 жыл бұрын
Hey man, you are doing great job in this tutorial, your explanations are logical and simple unlike some other guys here. Thanks and I wish you all the best. Cheers.
@dougmilford7814
@dougmilford7814 5 жыл бұрын
Thanks for clicking 'Like' and Subscribing!
@ati43888
@ati43888 Жыл бұрын
Muazzam bir ders anlatış tarzı. Thanks
@antonioastorino7488
@antonioastorino7488 4 жыл бұрын
Pause for a second... I'm making popcorn :) Great videos!!
@MaxVinstappen
@MaxVinstappen 3 жыл бұрын
I love your videos Doug
@michalbotor
@michalbotor 2 жыл бұрын
hey doug, what is the difference between `{};` and `{}` in rust? why does this: `{ let v = 1; v };` work but this `{ let v = 1; v }` returns an error?
@Jordan4Ibanez
@Jordan4Ibanez 4 жыл бұрын
Hey Doug, in the parenthesis explanation I noticed this: With some_bool == true || (some_int > 100 && some_int2 == 200) it's equivalent to some_bool == true || some_int > 100 && some_int2 == 200. BUT If you do: (some_bool == true || some_int > 100) && some_int2 == 200 suddenly check 1 OR check 2 has to be conditionally correct AND condition 3 has to be correct. But thank you for the tutorial regardless :)
@leoxiaoyanqu
@leoxiaoyanqu 3 жыл бұрын
Thanks a bunch for the great series of Rust tutorials! Quick question on the match branch `1 | 2 => ....`, how does Rust handle the case of bitwise-OR vs this logical or? 10:23
@Baron-digit
@Baron-digit 4 жыл бұрын
Hi Doug, great videos, you really help me out here! Just a quick Q: Is there a memory or speed advantage between match and if?
@dougmilford7814
@dougmilford7814 4 жыл бұрын
I don't believe so, but I'm not 100% sure. If anything it's minimal. The advantage is for developer ease-of-use in my point of view.
@Baron-digit
@Baron-digit 4 жыл бұрын
@@dougmilford7814 thanks!
@kevinwang6188
@kevinwang6188 3 жыл бұрын
@@dougmilford7814 the compiler will do its best to optimize it in either cases which may result in the same assembly.
@luong87mipec
@luong87mipec 3 жыл бұрын
Thank you very much
@davidhilsabeck
@davidhilsabeck 4 жыл бұрын
What's up with the diatribe on parens? As a developer you are expected to understand operator precedence, and include only those parens that are necessary.
@Jordan4Ibanez
@Jordan4Ibanez 4 жыл бұрын
I also noticed this, with some_bool == true || (some_int > 100 && some_int2 == 200) it's equivalent to some_bool == true || some_int > 100 && some_int2 == 200. BUT If you do: (some_bool == true || some_int > 100) && some_int2 == 200 suddenly check 1 OR check 2 has to be conditionally correct AND condition 3 has to be correct. That's alright though because explaining vs understanding this is different. I'll comment in the main root of this comment section to clarify.
@maxbashyrov5785
@maxbashyrov5785 5 жыл бұрын
"if" is not a statement, but an expression - doc.rust-lang.org/reference/expressions/if-expr.html that's why it can return the result of evaluation - doc.rust-lang.org/reference/statements-and-expressions.html
@sergesolkatt
@sergesolkatt Жыл бұрын
💛💚
Rust Tuples
8:48
Doug Milford
Рет қаралды 7 М.
Rust Ownership and Borrowing
38:21
Doug Milford
Рет қаралды 69 М.
ССЫЛКА НА ИГРУ В КОММЕНТАХ #shorts
0:36
Паша Осадчий
Рет қаралды 8 МЛН
Counter-Strike 2 - Новый кс. Cтарый я
13:10
Marmok
Рет қаралды 2,8 МЛН
«Жат бауыр» телехикаясы І 26-бөлім
52:18
Qazaqstan TV / Қазақстан Ұлттық Арнасы
Рет қаралды 434 М.
Rust Functions and Procedures
13:31
Doug Milford
Рет қаралды 11 М.
Rust Branching - if let, match
9:21
Code to the Moon
Рет қаралды 29 М.
Rust Modules - Explained Like I'm 5
19:59
Let's Get Rusty
Рет қаралды 78 М.
5 deadly Rust anti-patterns to avoid
13:25
Let's Get Rusty
Рет қаралды 39 М.
Rust Match Expressions and Patterns 🦀
35:51
Trevor Sullivan
Рет қаралды 8 М.
12 Things to Help You Learn Rust
36:40
Gary Explains
Рет қаралды 90 М.
Understanding Strings in Rust - String vs &str
6:29
Federico Terzi
Рет қаралды 19 М.
Rust Generics
22:10
Doug Milford
Рет қаралды 22 М.
Rust Structs, Traits and Impl
24:53
Doug Milford
Рет қаралды 34 М.
Writing Code That Runs FAST on a GPU
15:32
Low Level
Рет қаралды 577 М.