Rust Collections Explained

preview_player
Показать описание

A rundown of Rust collections and iterators, including a bit about what's going on behind the scenes.

Рекомендации по теме
Комментарии
Автор

I strongly disagree socks and coal are "junk". These items keep you warm in winter. Can't do that with diamonds and emeralds (unless you buy socks and coal with them).

flippert
Автор

BIG YES to this kind of Rust knowledge. It bridges the gap for JS / Python devs nicely

Cmndd
Автор

Just as a tip, it might be a good idea to disable code ligatures for the code snippets, at least for videos covering fairly fundamental parts of a language. It might not be hard for people who aren't used to it to figure them out, but it is a small barrier to reading them

NekoApril
Автор

at about 8:51 the the can be rewritten as entry(...).or_default() which clippy will helpfully tell you to do too :) This works because the Default impl of Vec gives you an empty vector.

MichaelKefeder
Автор

The quality of this video is awesome! Please please make more videos like this, the length and content covered is just right.
While there are quality videos out there, they end up being very long and unfocused leading to videos closer to an hour long....

ryanswatson
Автор

more of this content please, break down of all the most commonly used rust patterns :)

leemack
Автор

hey! first off, great video! really enjoyed and (as always) your explanations and presentations are superb!
I know this is supposed to be a a recap/short introduction, but I would love to have a bit more in depth explanation about each of the methods (present some more use cases, explaining a bit more the under the hood, etc)
but other than that, amazing video!

roeetoledano
Автор

The difference between into_iter and iter in terms of borrowing is not something I’d ever seen articulated. That’s why all my advent of code solutions have twelfth order references!

MyopicSquirrel
Автор

In rust functional operations on collections are not as user friendly as they could be.

From a user point of view the .iter() and .collect() add unnecessary fluff.

If you're operating on a vector, exposing map directly on vector is useful, and its not that far from how its already used by the for loop.

azthecx
Автор

Thanks! Really good explanation of collections and iterators!

sergeykuznetsov
Автор

My favourite rust feature is exactly this.
The type system and other features that accomodate it.

theycallmesloth
Автор

Great video!
One thing is magical but quite confusing though: you have a Result<Vec<String>, String> but in map() you only return an Ok(String) not an Ok(Vec<String>).
I tried it and was actually surprised that it works.
How does Result FromIterator "merge" these into the resulting vector?

artxiom
Автор

i watched this video while on my coffee rush. I am intimately familiar with the topics you covered in this video. Thank you so much for connecting to me on a deep level!

christerpherhunter
Автор

Thank you SO MUCH for this video! It finally cleared up the confusion about all this iterator stuff!

AMusset
Автор

I love this channel

Taught me so much stuff about rust.
I always recommend it to other people who learn rust

Thank you so much

sususu
Автор

4:01 I don't think you should use clone there 😂

taquanminhlong
Автор

Very nice explanations of some basic concepts that trips people up. More of this type of content please!

sanjsahayam
Автор

Super informative video, the only bit that I wasn't clear on was why the Result<Vec> would stop iterating on the first error it encountered? It sort of makes sense from context but I don't know where that leaves things like the resulting vec or if you can no longer use the collection (as it's been consumed) and you can't access the elements as you only have the Err variant back?

(I've been much more likely to use the Vec<Result> type so understanding the "rusty" way to do the same thing properly would be awesome!

pancakedrivet
Автор

More of these please B0ss 🤣🤣
I’d love to see a sectioned series covering all the traits in the std lib (and maybe some of the extension crates traits that are super popular like itertools)

Hellbending
Автор

thanks a lot for the good work, the beard is awesome 😎 sir

benspencer