Mastodon Feed: Post

Mastodon Feed

jsonstein@masto.deoan.org ("Jeff Sonstein") wrote:

"The push_str method takes a string slice because we don’t necessarily want to take ownership of the parameter."

so, I can pass around and use string slices ("usually seen in its borrowed form &str... references to some UTF-8 encoded string data stored elsewhere") while clearly hanging on to ownership and management of big-S String-thingies ("growable, mutable, owned, UTF-8 encoded") as the data structures they are. good. this makes sense... or more probably, I'm missing something subtle ;^}

#LearningRust