News for hackers. Stuff that matters.
Re:Strings Are Evil by Razengan on Wednesday June 20, 2018 @01:04PM (#17357210)
> Rust's splitting iterators over `&str` return references to the same data as their own `&str`s, which is a huge performance win.

Seems similar to Swift's Substrings (and other collection "slices"):

https://developer.apple.com/documentation/swift/substring

Re:Strings Are Evil by iamed2 on Monday June 25, 2018 @04:32PM (#17395551)
Similar, except for this key difference:

> A substring holds a reference to the entire storage of the string it comes from, not just to the portion it presents, even when there is no other reference to the original string.

Rust's `&str` doesn't do that, since the borrow checker will ensure at compile time that the `&str` reference doesn't live longer than the data it points to. At runtime there is no structural difference between an "original" `&str` and a `&str` pointing to a substring of the original.