Re:100 days with Rust: a series of brick walls
by steveklabnik on Friday March 23, 2018 @05:53PM
(#16662908)
FWIW, this is why we go over this stuff in the book now; lots of people struggle with it, it's not just you.
And yeah, Deref doesn't kick in everywhere, so you may need the .as_str() in those situations. It should be the extreme minority case, generally. Same with .to_string(), though moreso. Most stuff should take &str, not String.
And yeah, Deref doesn't kick in everywhere, so you may need the .as_str() in those situations. It should be the extreme minority case, generally. Same with .to_string(), though moreso. Most stuff should take &str, not String.