There are 1664 occurrences of .unwrap() in uutils, the Rust replacement of GNUs coreutils.
>>107270830>crabs are mentally retardedmore news at 11<heres uutils' test results>use it anyways, chudack, the language
>>107270878Ubuntu extended LTS to 15 years because that's how long they expect uutils to be absolutely unusable toy as a bare minimum.
>>107270830Never trust a crab.
>>107270830And?
>>107271303I expect a bullet going through the back of his head.
>>107270830>Ubuntu going full AAACCK with Rustvery fitting
>>107270830haha OP I love froggo XD
>>107271343glad that you appreciate my frog thread
>>107270830What was the old code doing if the new code has so many unwraps?
>>107273403Performing better and without issue for decades.
>error handlers handle errorsyou don't say
omg guys. i was writing a crate for the first time, and started with the test suite before doing the actual implementation. so as you would expect, almost all tests were failing. but after your tips here, i looked for all instances of unwrap and removed them, and now most of my tests pass, without doing any extra implementation work! unwrap is really problematic, isn't it?anyways, this is the best fucking tip ever. i'm so glad i discovered /g/.
not sure if it's hilarious or sad because they try to make rust like cobol by forcing ubuntu to include it in loooong lts version. or this is a sneaky way to outsource rust written utils to be maintained by canonical.
>>107274288and of course not a single /g/tard understood the joke.which tard from the jeet-zog xitter scene (i'm guessing) came up with this grep stat btw?
>>107270830no idea what this unwrap() shit is about and don't care, but if they need to rework 1664 occurrences that's not a lot at all
>>107270830How many instances of 'unsafe'?
>>107273403>What was the old code doing if the new code has so many unwraps?Silent memory corruption and arbitrary code execution.
>>107275534unwrap means that there's a tagged union, but the program should assume that the tagged union is the happy variant, otherwise panic.There's been growing concern by Rust users about the presence of unwrap and unsafe in codebases that don't really need it, and that concern is probably about to escalate into dogmatism.
>>107270830This is a problem how exactly?It wouldn't matter if abort() was in GNU coreutils. These are command line programs—not your high traffic web server that's supposed to run 24/7/365. Nobody running them should assume they won't terminate unexpectedly or print an error. Anyone running them as a script automatically should be checking the exit code unless they're insane or don't care.
>>107275802All code execution is arbitrary
Error functions that make your program terminate unexpectedly can be fine if used the right way. In fact they can be a genuine benefit if you use them when you encounter conditions that defeat all assumptions and put your program in an unrecoverable state. Basically, abrupt termination is fine if you encounter a condition that indicates a bug in the program that is so bad that continuing will cause harm in some way or if it indicates the program has been hacked or tampered with.
>>107270830Is this the new gets()?
>>107270830>unwrap badAnother nonprogrammer who shouldn't be in /g/.