Are any other @rustlang folks bothered by `Vec` over `Vector` but `Option` over `Opt`? (And a billion other things that are abbreviated that don't need to be)
-
-
I like Vec and Buf, honestly. I think Opt and Res would drive me insane though, and I'm not sure I can articulate the difference
1 reply 0 retweets 2 likes -
I'm arguing for longer names, not abbreviations FWIW. Even if you like the `Buf` suffix, I think that's an argument for `String` and `StringBuf` over `str` and `String` ;)
1 reply 0 retweets 2 likes -
I phrased that poorly. I agree that I'm glad Res and Opt aren't real. I don't mind Vec and Buf as half words and I'm not sure why offhand. I'm trying to imagine their full words in use and I'm not sure how I feel about it yet
1 reply 0 retweets 1 like -
I could go for a lowercase string as the primitive/slice type and StringBuf as the growable, yeah
1 reply 0 retweets 1 like -
"There is no reason for `str` to be lowercase" is absolutely a hill I am willing to die on, but I totally get the argument for it being lowercase. (My personally opinion is that it should just be &String and the compiler should just deal with optimizing cap away(
1 reply 0 retweets 0 likes -
Isn't &String currently a thin pointer, while &str is fat?
1 reply 0 retweets 0 likes -
Yes. I fully understand the differences between the types, and the technical reasons they are separate. As a user I don't care, this is a compiler/language problem
2 replies 0 retweets 1 like -
Don't get me wrong, I'm asking as a bounds check before I say something stupid, not to be a language lawyer
1 reply 0 retweets 0 likes
Sorry for assuming. -- Yes, you are correct. `str` is basically `[u8]` which is guaranteed to be valid UTF-8. As an unsized type, it cannot appear on its own. &str is a fat pointer which also contains the length. 1/2
-
-
String is literally a struct which just wraps Vec<u8>, which is a pointer, a length, and a capacity. &String is a normal pointer to that struct.
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.