1:58 Rust has a return keyword. Returns are implicit at the end of a function, and leaving them implied at the end is idiomatic, but early returns still use the return keyword.
@francescociullaАй бұрын
you are right! I think this is the best way to introduce it to the beginners, but thanks for pointing it out!
@Brocodefound1677Ай бұрын
Finally here 😃 Francesco where is the practise excercise?
@francescociullaАй бұрын
what do you mean?
@ossurfАй бұрын
Francesco n. 1!!!!!!!!!
@francescociullaАй бұрын
ecco il secco!
@ossurfАй бұрын
manca poo ai 300.000!
@francescociullaАй бұрын
quasi!
@ok-alarmАй бұрын
still struggling with lifetimes and some ownership rules. 😅
@francescociullaАй бұрын
I can feel you, have you checked the dedicated videos?
@antoniong4380Ай бұрын
The way you explain Return and lifetimes might cause misunderstanding.
@antoniong4380Ай бұрын
Return are optional keywords. Can be used to do an early return instead of "There's no return keyword". Or rather, it should've been "Has implicit return" Lifetimes analogy would make more sense if you say "I can't leave yet because you have my 'ticket plane'" instead of "You haven't returned my book" This (oversimplified) implies that an action can't be done because the green-ticket to do something is currently held by someone else. Also, the example of the function isn't really helpful. It is more relevant to the callsite, instead of the function body. In the context of the function, the return lifetime will be the overlapping range(or shortest lifetime) of both parameters. This nuance, however only matters to the callsite, and is easier to see why lifetime would matter.
@francescociullaАй бұрын
Hey Antonio, yes you are correct. I use the return keyword and I thought this was more to show the beginners the best practice, but yes, there's the return keyword in Rust and I probably will make a comment about this. About lifetimes, that's a nice analogy, I should have used it. Thanks for taking the time to write this!
@xl0xl0xl0Ай бұрын
Is this video AI-generated?
@francescociullaАй бұрын
no it's me reading and there is an editor
@Dev-Dojo-channelАй бұрын
Respected sir, please make the rust series from begginer to advanced. You are a phenomenal teacher 🎉🎉🎉. Please do it.
@francescociullaАй бұрын
Hi dev dojo. Here si the playlist you are looking for: kzbin.info/aero/PLPoSdR46FgI412aItyJhj2bF66cudB6Qs
@Dev-Dojo-channelАй бұрын
@francescociulla I already started following it. It's a 💎. Thank you Sir.🙏
@Dev-Dojo-channelАй бұрын
@francescociulla add some real world projects SIR, please 🙏