Rust - Simple Code Layout (start simple, scale better)

Rust - Simple Code Layout (start simple, scale better)

Jeremy Chone

1 год назад

48,632 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

June At Home
June At Home - 24.11.2023 15:39

Do you have rust tutorial for beginners?

Ответить
Mike Houghton
Mike Houghton - 22.11.2023 22:49

Excellent videos thanks! Do any of your other videos show examples of using the newtype wrapper pub struct W<T>(pub T); for trait implementations? Thanks.

Ответить
Leonardo Ribeiro
Leonardo Ribeiro - 13.11.2023 17:49

Direct to the point! Love it! <3

Ответить
Adam Duvick
Adam Duvick - 27.10.2023 01:06

This was very informational to watch. Could this also be achieved by writing a function to operate on DirEntry & produce Result<String>? Is there a benefit of adding the trait implementation versus just having a local function?

Ответить
jaredthanemartin
jaredthanemartin - 10.10.2023 01:28

I love your videos. you have taught me so me great little rust tricks and patterns. Keep up the great work!

Ответить
TheRealGamer
TheRealGamer - 16.07.2023 00:22

Forgive me for being dumb but as a c# developer i don't understand the motivation behind what i just watched. Anyone care to explain what the W wrapper thing is for??

Ответить
Hughes D. Mungus
Hughes D. Mungus - 03.07.2023 02:38

I could never find a video explaining a good way to begin to structure a Rust project. This seems like a great way of doing so. Thanks for such a simple and understandable video!

Ответить
gduan2000
gduan2000 - 09.05.2023 06:58

very helpful especially that wrapper pattern

Ответить
Hamza Mohd. Zubair
Hamza Mohd. Zubair - 05.05.2023 18:52

i like this channel, the only problem with this channel is that there are too few videos

Ответить
Bitwise
Bitwise - 02.02.2023 05:41

Small tip: instead of results.filter_map(|e| e.ok()) you can do results.flatten().

Ответить
Eduardo José Álvarez Chacón
Eduardo José Álvarez Chacón - 22.01.2023 16:59

This is one of the best Rust intro videos that I've ever seen. Thank you!

Ответить
Neil Pate
Neil Pate - 20.01.2023 13:59

Nice video, thanks. What theme are you using for VSCode?

Ответить
dabaal
dabaal - 06.12.2022 22:54

Congrats for all your videos? I have a little question. Why anyhow is used as dev-dep? Thank you a lot in advance!

Ответить
Non je ne suis pas Swiiz Arretez c'est faux
Non je ne suis pas Swiiz Arretez c'est faux - 04.12.2022 22:32

If you don't want to be using a wrapper, you can also simply define your own trait with the appriopriate function and implement it for the extern struct. It is cleaner that way in my opinion but i guess it's a matter of preferences

Ответить
Non je ne suis pas Swiiz Arretez c'est faux
Non je ne suis pas Swiiz Arretez c'est faux - 04.12.2022 22:27

The creation of a utils module i would say is an anti pattern, you could would be more readable and clean fitting the utils with related code. Give me your thoughts about it

Ответить
wjd5527766
wjd5527766 - 18.11.2022 18:52

Hey Thanks for good quality content!
May I ask you one question?
How to enable quick fix for creating module?

Ответить
Jacek M.
Jacek M. - 15.11.2022 15:37

O! that is so useful! Thank you so much!

Ответить
Caden
Caden - 13.11.2022 14:45

Great content, thanks!

Ответить
Learn IT
Learn IT - 12.11.2022 01:33

Really good presentation style. I would love to see more of this for different patterns i.e builder. Anyhow thanks for great content.

Ответить
Dr. Maybe
Dr. Maybe - 09.11.2022 20:20

You earned my subscription in the first 90 seconds. Lots of useful productivity tips, love it!

Ответить
Crypto Patrick
Crypto Patrick - 08.11.2022 10:54

OMG! I'm loving the French accent! 🥐☕😀

Ответить
cozyGalvinism
cozyGalvinism - 08.11.2022 00:57

This is a great quick start!

Ответить
Chaqua
Chaqua - 08.11.2022 00:42

I'd love a guide on clap

Ответить
porky11
porky11 - 07.11.2022 21:17

Code lens is confusing, especially in tutorials, and I hate it in general.

Ответить
porky11
porky11 - 07.11.2022 21:15

I don't think, creating an error type before you know anything about your code is such a good idea.
I'd just create custom error types depending on the possible results. And sometimes it's enough to just forward some existing error type, especially when doing IO.

I also wouldn't add the prelude at the beginning. I don't really like prelude to begin with, but if I'd add one, I'd add it right before publishing.

The newtype pattern should normally be avoided. This is just a hacky workaround for the orphan rules. If it's needed, I'd rather create custom newtypes.
But in this case, I'd rather create a function or an extension trait.

The utils module is a good idea in my opinion. I create it, if I realize, I need some helper function in multiple places.

I also hope, you somewhere have a template already set up, if you start like this anyway.

Ответить
Casimir Poh
Casimir Poh - 07.11.2022 18:43

snake_case for some of the name and concatcase for some of it, using non-word concatcase for the rest of the name? (direntry_froms) Also, it is difficult to reason as to where does this type come from with this naming scheme. A maze of idiosynchronicities... Consider your code as your message to the rest of the World. The Other People. Or something, Rust is what it is, and it ends up not making this easy, and the base level of contemporary programs complexity simply isn't easy, either.

Ответить
Smoq _
Smoq _ - 07.11.2022 17:16

Hi,

I just discovered your channel and I think it’s great !
I’m a PHP developer, and trying to learn rust is quite hard for me.
Could you, by any chance, make a video about understanding rust documentation better (I find it quite hard to read) ?
You could list ways to easily find the method you are looking for.
Also, I feel like in rust there is a lot of ways to do essentially the same thing (say string manipulation), could you explain us maybe the best one to use in a specific case or something like that ?

Thanks for your content !

Ps: t’est français non ? 😅

Ответить
Dot32
Dot32 - 07.11.2022 06:05

am i the only person who has no idea what any of this is doing

Ответить
dragonmax2000
dragonmax2000 - 07.11.2022 05:43

This is so awesome and very practical. Thank you!

Ответить
iMalignus
iMalignus - 07.11.2022 05:13

Sorry but the accent is causing me some issues, what is the "xnl" trait in "xnl" type? Can someone clarify this?

Ответить
CodeShow
CodeShow - 06.11.2022 23:56

Awesome, thanks for this.
Which tool do you use to annotate those lines on the screen?

Ответить
eignnx _
eignnx _ - 06.11.2022 23:43

Omg I love that wrapper pattern, it's like extension methods in kotlin but a little more explicit! I think I'll try naming my wrappers after the crate cause I find W a little mysterious, but I'm definitely using this

Ответить
zej at VLSgg
zej at VLSgg - 06.11.2022 22:10

Thanks for this! Most tutorials asume you know the basic structure. this is so helpful!

Ответить
M.Berki
M.Berki - 06.11.2022 19:56

Lets take a minute to appreciate good quality content like this ❤

Ответить
Tofixrs
Tofixrs - 06.11.2022 18:02

🤯

Ответить
Wander Watterson
Wander Watterson - 06.11.2022 17:42

I thought this is just another video that shows how module in rust works, until that tryfrom method, i fell like a beginner now, thank you so much for the video!

Ответить
Александр Каравайчик
Александр Каравайчик - 06.11.2022 17:12

Oh my god, this tutorial should be in the first chapters of Rust Lang Book. So simple and clear, you just blew my mind off. Thank you so much, you just got a new subscriber!

Ответить
Eran Boodnero
Eran Boodnero - 06.11.2022 17:10

Yesssss thank you for this!!

Ответить
kristian
kristian - 06.11.2022 17:02

this is liquid gold for me

Ответить
And
And - 06.11.2022 17:00

Amazing explanations!

Ответить
E Mail
E Mail - 06.11.2022 16:42

Content and presentation is superb. Thank you.

Ответить
Ernest M. van der Linden
Ernest M. van der Linden - 06.11.2022 16:27

thanks 🤙

Ответить