Assigning "Bob" to variable "a" and "Alice" to variable "b" is just evil
@ohturry55912 жыл бұрын
Lol😂
@ohturry55912 жыл бұрын
It’s an sql relationship 🤫
@codetothemoon2 жыл бұрын
hah, in retrospect that was a poor choice 🙃
@ThanhNguyen-lk6ns2 жыл бұрын
It's a quantum teleportation 🤣
@furo.v2 жыл бұрын
I was going to comment the same thing lol
@robinmoussu2 жыл бұрын
I definitively love your style. Clear, short, on-topic!
@codetothemoon2 жыл бұрын
Thanks Robin!!
@TripleNipplFishh Жыл бұрын
I have to say, you really got the best Rust content. exactly the right tempo and right hints
@codetothemoon Жыл бұрын
thanks so much!
@perc-ai2 жыл бұрын
This is the best rust macro video on KZbin! Looking forward to all your future videos your quickly brecoming an industry leader
@codetothemoon2 жыл бұрын
wow thanks for the kind words! I really enjoy making them!
@asnafix2 жыл бұрын
love your explanation style, simple, clear and well structured
@codetothemoon2 жыл бұрын
Thanks Tryo!
@AceofSpades57572 жыл бұрын
That was a really good, light introduction into Rust's declarative macros. Thanks!
@codetothemoon2 жыл бұрын
Thanks AceofSpades! It's almost as if the title and thumbnail were speaking directly to you 🙃
@eduardopereira24312 жыл бұрын
Your Rust content its been incredible useful! Thank you!
@codetothemoon2 жыл бұрын
Thanks Eduardo, thanks for watching!
@Ma1ne22 жыл бұрын
Loving these Rust videos so much, great to follow along and learn something new :) Keep them coming!
@codetothemoon2 жыл бұрын
Thanks Noxdor, glad you are finding them valuable! more to come!
@BrandonCharlesHouser Жыл бұрын
In VS Code, if you hold alt and then press the up or down arrow it will move the line you are on or your entire selection up or down. It's great for reorganizing switch statements, if else ladders, and just re-organizing code.
@codetothemoon Жыл бұрын
ahh didn't know about this, thank you!
@egorsozonov742510 ай бұрын
It’s not great, it’s terrible. Pressing Alt and arrows at the same time requires you to move your hand very far from the home row! Better editors like Neovim have saner hotkeys as well as a way to reassign them arbitrarily
@sparky173j2 жыл бұрын
Thankyou for this and all your other videos. I usually prefer learning these things from video demos over documentation. I've been procrastinating adding macros to my project. I'll probably mostly be using derive macros, but I think declarative macros will be a good place to start.
@codetothemoon2 жыл бұрын
Thanks for watching tev. I really enjoy making them, especially when I get comments like this! Declarative macros can be a great place to start (though you don't have to). Will probably be making a custom derive video at some point...
@Akshay-be3qx2 жыл бұрын
Really cool way to explain. Thanks for taking time to make awesome videos.
@codetothemoon2 жыл бұрын
Thanks for watching Akshay!
@perc-ai2 жыл бұрын
Hey there’s a new wave of rust developers especially after all the news that rust is changing everything… would love to see more videos from you
@codetothemoon2 жыл бұрын
Thanks Zah, more are on the way!
@learntry9074 Жыл бұрын
Each video by you is to the point, and really it has helped me a lot. E.g, the video on 'result', I knew Result enum, but after watching it I learned the use case for map_err. Thank you
@jeffg46862 жыл бұрын
Found an interesting syntax today, which is tuple pattern matching, where all elements of the tuple value can become 'wildcard' matches / variables'.
@codetothemoon2 жыл бұрын
I find this feature super handy, I think it's called "destructuring"!
@jeffg46862 жыл бұрын
@@codetothemoon - yeah, it's destructuring, but never seen it before in this context (matching).
@HyperFocusMarshmallow Жыл бұрын
Great introduction!!! It would be cool if you did one or a few follow ups of more advanced macros.
@ErikSchierboom2 жыл бұрын
Lovely video! Love your pacing
@tuanlam9992 жыл бұрын
Great concise content. Rust to the moon 🙂
@codetothemoon2 жыл бұрын
Thanks Tuan! 🌙
@rockNbrainАй бұрын
Great job bro!!
@codetothemoonАй бұрын
Thank you, glad you liked it!
@tonhom260 Жыл бұрын
Love the way you teach us ,thank❤❤
@eddex.2 жыл бұрын
Why did the "thing = 5" variable match the "a arm"? And how can it match "a" when there's no variable called "a"?
@theaiguy_ Жыл бұрын
That is because a can be anything, 5 included, so it matches.
@theaiguy_ Жыл бұрын
Usually the general case is named "_", but really can be anything
@kavehtehrani9 ай бұрын
@@theaiguy_ thank you kind stranger!
@aksakalaradhita Жыл бұрын
Man, you should have "in-depth rust" series
@codetothemoon Жыл бұрын
would love to make such a thing!
@glebbash2 жыл бұрын
Great stuff, sounds like macros are not that scary after all.
@codetothemoon2 жыл бұрын
Thanks, indeed they are not! 😎
@advanceringnewholder11 ай бұрын
I wish you deep dive into procedural macro. I'm having a hard time wrapping my head around it.
@codetothemoon11 ай бұрын
yeah i'd love to do this. i actually started writing a video about it awhile back but found it really difficult to present it in a clear way in the KZbin video format
@pierreniberon18012 жыл бұрын
Firstly, nice thumbnail, and then, nice video 👍
@codetothemoon2 жыл бұрын
Thanks Pierre!
@artursradionovs95432 жыл бұрын
Does anyone know how to implement Stripe and JWT in rust for e-commerce
@codetothemoon2 жыл бұрын
I second this. I've been mulling a Stripe video for some time, definitely a huge area of interest. For JWT / OAuth in Rust I actually did a video on that several months ago
@artursradionovs95432 жыл бұрын
@@codetothemoon no official docs available. I love Rust a lot, but it takes a lot of time as a beginner to pick this up. My goal is to develop a small Android Native App with Actix as a backend framework, but note sure if I will succeed. Rust really is harder than Java, Python or JS.
@Daveiac2 жыл бұрын
Is there a way to specify the types of elements to the set? Like what if you were to do set!(1,"2",'3'), would it compile?
@ianakotey2 жыл бұрын
Nah, compiler would infer their types are different and reject
@codetothemoon2 жыл бұрын
yeah like Ian mentions, the HashSet itself has to be of a specific type so this wouldn't compile - this isn't related to the macro itself, it would still happen if you tried to do that directly with HashSet::from
@legends_assemble4938 Жыл бұрын
Can u create a video on getting started with procedural macros.
@codetothemoon Жыл бұрын
I'd love to do that, and I actually started writing a script on at least one occasion, but I've found them to be incredibly challenging to explain in a simple way. I'll come back to it at some point 😎
@legends_assemble4938 Жыл бұрын
@@codetothemoon Thanks for considering my request 💛💛
@AzureFlash2 жыл бұрын
3:39 Trolling is a art
@codetothemoon2 жыл бұрын
If I trolled it wasn't intentional! 🙃
@africknchickn_YT2 жыл бұрын
if you do a similar walkthrough for proc macros, I *will* subscribe. In my experience, building a custom derive is a more common use case that I wish I had the time to learn in detail how to do, as opposed to defining and parsing a new DSL. So (if you're taking votes...) my vote would be for doing a recursive derive of structs and enums! If not, then no worries :) I'll still be around. Cheers dude!
@codetothemoon2 жыл бұрын
Nice, I've been thinking a lot about a proc macro video. I've found it incredibly challenging to explain those concepts in a concise and digestable way - I think it can be done though! Thanks for watching!
@edgeeffect Жыл бұрын
@@codetothemoon yeah! I've just been watching "9 rules for procedural macros" and my head is still swimming.
@advanceringnewholder11 ай бұрын
@@codetothemoonCheering on that. I hope you'll make that video and adding it to the knowledge pool of easy to digest video. Take your time
@ozkavoshdjalla2 жыл бұрын
It was cool! Thanks
@codetothemoon2 жыл бұрын
Thanks for watching Ozkavosh!
@narayanbhat32792 жыл бұрын
shouldn't you first create an empty hashset and then push each of the elements into the set?
@codetothemoon2 жыл бұрын
That would work too. I'm honestly not sure which approach is more efficient.
@diwakargupta02 жыл бұрын
Awesome 🙌🙌
@codetothemoon2 жыл бұрын
glad you found it valuable!
@KyuuKun162 жыл бұрын
Your videos are AMAZING, would you consider making one delving deeper into concurrency?
@codetothemoon2 жыл бұрын
Thanks Jason, I'd love to do one on concurrency - it's already on the video idea list!
@grindarius6612 жыл бұрын
What kind of theme are you using? It is so cool and I wanted to know the name of it.
@codetothemoon2 жыл бұрын
Thanks, it's Sonokai!
@arnimlost2 жыл бұрын
@@codetothemoon what font are you using?
@zencephalon2 жыл бұрын
Great stuff!
@codetothemoon2 жыл бұрын
Thanks Matthew!
@ambuj.k2 жыл бұрын
What is your vscode theme in this video?
@codetothemoon2 жыл бұрын
Sonokai
@codeplay49472 жыл бұрын
What is your color theme
@codetothemoon2 жыл бұрын
Sonokai
@codeplay49472 жыл бұрын
@@codetothemoon Do you mean Monokai...I couldn't find Sonokai
@alurma Жыл бұрын
ty
@codetothemoon Жыл бұрын
you're welcome thanks for watching!
@glennmiller3942 жыл бұрын
Thanks!
@codetothemoon2 жыл бұрын
Thanks for watching Glenn!
@jaromor88082 жыл бұрын
what's up with that extra/last comma in the dbg! output?
@van3ll0pe2 жыл бұрын
C > rust I love c
@codetothemoon2 жыл бұрын
What do you like most about C that Rust falls short on? What issues do you think C has that could be addressed in a future language?
@not_ever Жыл бұрын
@@codetothemoon Rust doesn't segfault enough. A real language segfaults at least three times before breakfast.
@Elduque402 жыл бұрын
Do you have Rust for beginners?
@codetothemoon2 жыл бұрын
Check out "Rust Demystified"! It goes straight to the heart of what makes Rust different from other languages
@phenanrithe2 жыл бұрын
The best I've read is this book: Programming Rust by Jason Orendorff, Jim Blandy, and Leonora F .S. Tindall, O'Reilly. It covers the last 2021 edition, is superbly written and covers all the topics by explaining everything with a good learning curve. I've heard good things about The Rust Programming Language by Steve Klabnik and Carol Nichols, no starch press, but it's outdated (a new edition should be available later next year).
@tsalVlog Жыл бұрын
we call it the mustache brace around here.
@codetothemoon Жыл бұрын
nice! sounds far better than "curly braces"
@kennethbeal2 жыл бұрын
"Aces!" - 16 Candles
@codetothemoon2 жыл бұрын
Hah, I had to look this up!
@tactics402 жыл бұрын
nit: println takes a string literal, not a slice. One of the hallmarks of a macro is that it can distinguish the two whereas functions can't.
@codetothemoon2 жыл бұрын
Ahh good point I was sort of using those terms interchangeably, but like you say in the world of macros they are different!
@banocean Жыл бұрын
Tbh your videos now are kinda let's do thing I can read in the docs/rust book :/
@codetothemoon Жыл бұрын
thanks for the feedback. I only make videos on topics that are covered in the Rust book if I think i can offer a different approach and explanation that makes it easier to understand, which was the case for this video. Another example would be the one on interior mutability. Maybe I missed the mark on this one!
@Singlton7 ай бұрын
Bro, your tutoriall are amazing, post discord or telegram groups please♥️🙏