|
|
|
|
|
by steveklabnik
3027 days ago
|
|
So, we almost made str a library type, but there were downsides and not a lot of upsides. https://github.com/rust-lang/rust/pull/19612 > no other data type does? You could argue that slices are a primitive type to arrays (also a primitive type) and vectors (a library type). > Why does there need to be a distinct data type for a non-owned view into an object? The difference between owned and non-owned types is fundamental; how would you propose distinguishing them if not as part of the type? Both concepts are part of the language, but like any language, you can use its fundamental bits to build better abstractions. |
|