News for hackers. Stuff that matters.
Re:String types in Rust by pixel_fcker on Monday March 28, 2016 @05:39PM (#11377629)
Thanks for this is was very helpful.

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.

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.
Re:String types in Rust by bjz_ on Tuesday March 29, 2016 @03:48AM (#11380090)
What were the drawbacks?
Re:String types in Rust by steveklabnik on Tuesday March 29, 2016 @10:53AM (#11381891)
Re:String types in Rust by bjz_ on Tuesday March 29, 2016 @03:47AM (#11380087)
I would be against giving the more expensive type the shorter name. That said, I kind of agree with Steve that having a `Buf` suffix would help.