Closed sgrowe closed 4 years ago
Thanks Sam. I'm a bit behind in my Read Rust publishing. I'll try to get those posted soon. I'm actually already subscribed to your feed and see that I have those two posts waiting to be read. :)
A comment on the first post:
&str
points to data that's already stored in aString
This is not necessarily the case. A string slice is not necessarily backed by a heap allocated String
. The most common example of this is string literals. These are stored in the .rodata
segment of the binary, thus they are a reference to that read-only (non-heap allocated) data.
Another example is the string slice could be a view into a C string (created via CStr::to_str).
Not sure if that distinction is important to you or not, but I thought I'd mention it.
Oh cool. Yeah, no rush with posting things.
And thanks for the feedback on the first post! I agree it was potentially a bit misleading so I've updated that a bit now :-)
Cool, both posts have been published now.
Hi, just wanted to suggest a couple of posts from my blog:
Post URL: https://fullstackmilk.dev/string_vs_&str_in_rust/ Author Name: Sam Rowe Categories: Getting Started
Post URL: https://fullstackmilk.dev/efficiently_escaping_strings_using_cow_in_rust/ Author Name: Sam Rowe Categories: Performance
Blog RSS/Atom/JSON Feed: https://fullstackmilk.dev/feed.xml