Open rjammala opened 7 years ago
I care more about 2,4,1.
Macros is too advanced for Intro.
&str vs &String
in Mutable borrows, 21:56. &String is changed to '&str'. no explanation of why.
all the small program I write in rust are text related. string in rust is really confusing to me.
a video on string or text processing will be great.
There was some discussion of &str
vs &String
in the previous video. At 11:13 of Shared borrows, he talks about changing &String
to &str
in the helper
function. That explanation made it clear to me why &str
would be preferable (it's more flexible). What wasn't clear to me was why we are allowed to do it. That is, why isn't it a type violation to hand a &String
to a function expecting a &str
?
I found the answer in the Strings documentation
String
s will coerce into&str
with an&
I didn't think automatic coercion was the norm for Rust. This is apparently part of something called deref coercions.
So, yeah--- I agree--- a lot more could be said about strings. I think a video on text processing would be a fine idea.
I have two videos coming:
After these I hope to do a bit more lifetime material, but I'll probably also start in on traits, as we have some slide decks for these already built. I'd love to do matching and enums too eventually.
Learning how to use Rustdoc, even though it's really simple might be worth highlighting. I'm not sure if we want to dive into the terminal or not, but at least some shots from docs.rs, and the STD lib would be great.
Maybe two sections, one for the language, and one for the ecosystem (cargo, rustdoc, etc).
@nikomatsakis : Thanks for all the videos. Do you have any timeline for the rest of them?
@nikomatsakis Thanks for doing this. These videos/exercises were very helpful.
When you get a chance, please also cover the following topics: