Re:String types in Rust
by steveklabnik on Monday March 28, 2016 @06:09PM
(#11377804)
Yeah, it's sort of historic. I like to joke that renaming String to StrBuf is my only wish for Rust 2.0.
That said, if anything, it would be StrBuf and str, because str is a primitive type, hence the lower case. It almost wasn't a primitive type, but there were drawbacks, so we kept it as one.
Re:String types in Rust
by Manishearth on Tuesday March 29, 2016 @07:15AM
(#11380677)
I believe that StrBuf or something similar was the name for a short time after the ~str removal.
What were the drawbacks?
Re:String types in Rust
by steveklabnik on Tuesday March 29, 2016 @10:53AM
(#11381891)
Honestly I think the main thing that trips people up here is the naming convention. If it was String and StringView rather than str I don't think people would have nearly as much trouble. I guess the name was chosen for brevity considering how pervasive &str is in rust code.