I'm kinda intrigued why the std library in @rustlang doesn't return results for adding numbers together rather than panicking at overflow.
-
-
Replying to @KingstonTime @rustlang
Overflow only panics on debug mode. I have abused this fact in programming competitions before.
1 reply 0 retweets 0 likes -
Replying to @jbinero @KingstonTime
You should use Wrapping! It’s only slightly longer and you’ll always get the semantics you want
1 reply 0 retweets 0 likes -
Replying to @rustlang @KingstonTime
Of course, but that requires opening the standard library documentation to figure out what the exact right function call is again. Not a good idea in time trials. :)
1 reply 0 retweets 1 like -
Replying to @jbinero @KingstonTime
That’s true, but if you learn it once, you don’t need to look it up every time :)
1 reply 0 retweets 1 like -
Replying to @rustlang @KingstonTime
*me quickly looking up how `Vec` works again*
1 reply 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.