Stringing things along
- Date: April 24, 2016
Vecs and slices (and Unicode) -- oh, my!
This episode, I take a deep dive on strings in Rust, looking at the
&str, discussing Unicode a bit, and then
expanding the discussion to think about how these types relate to the types
they're built on (like
Listener Nev pointed out to me that I got it wrong when describing how
&str data is stored. It is not stack-allocated, but rather goes in the
data segment. I should have said statically-allocated, not
stack-allocated. Thanks to Nev for the correction!
- Aleksey Pirogov
- Chris Palmer
- Derek Morr
- Hamza Sheikh
- Lachlan Collins
- Leif Arne Storset
- Luca Schmid
- Micael Bergeron
- Pascal Hertleif
- Ralph Giles ("rillian")
- Ralph "FriarTech" Loizzo
- Ryan Ollos
- Vesa Kaihlavirta
- William Roe
(Thanks to the couple people donating who opted out of the reward tier, as well. You know who you are!)
Demonstrate dereferencing. (You'll want to read this example carefully.)
Print a 🚀, just because we can.
Get a string slice. Note the required lifetime specifier on the type!
It's easy enough to get a