how come ethereum can hard fork & violate their entire value proposition but Rust can't even go back on promising that string.cap >= string.len
-
Show this thread
-
btw if we could go back on this promise you would never have to `"string".to_string()` again
2 replies 0 retweets 12 likesShow this thread -
Replying to @withoutboats
(pretty new to Rust) by cap do you mean capacity? https://doc.rust-lang.org/std/string/struct.String.html#method.with_capacity …
1 reply 0 retweets 0 likes -
Replying to @seanlinsley
Yep. We apparently promised that you can assume the length is less than the capacity, which rules out an awesome hack we wanted.
4 replies 0 retweets 1 like
Replying to @withoutboats @seanlinsley
But we could implement `.capacity()` by simply returning `cmp::max(self.cap, self.len)`. Does that solve the problem?
3:53 PM - 1 Dec 2017
0 replies
0 retweets
1 like
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.