3 ms·
I quite liked the tongue-in-cheek style. > The book really led me to believe there are literally two types of strings in Rust Oh you sweet summer child :) The
by baq 6y ago
I quite liked the tongue-in-cheek style.
> The book really led me to believe there are literally two types of strings in Rust
Oh you sweet summer child :) The joys of discovering that on lower levels, a String is not a str is an OsStr but is not a str and why that is are coming back to me.
Also, I particularly like the periodic table of rust types:
https://cosmic.mearie.org/2014/01/periodic-table-of-rust-types/ https://cosmic.mearie.org/2014/01/periodic-table-of-rust-typ...
This compared to almost any other language should tell you that Rust trades compilation speed for strictness and execution speed. It's really helpful to understand what you need to care about if you don't have a garbage collector working for you.
- CodesInChaos 6y agoRust has String, OsString, PathBuf, CString and Vec<u8> plus their borrowed equivalents. And the borrowed versions are often wrapped in `&`, `&mut`, `Cow` or `Box`. So many options in the standard library alone. There are several popular crates which add even more string/buffer types.
- pornel 6y agoAnd the cool thing is that thanks to borrowing and traits like Deref and Display, most of these types have a zero-cost common denominator in `&str` or `&[u8]` which makes them reasonably interoperable.
- deleted 6y ago[deleted]