It’s crazy that cloudflare of all people even had unwrap enabled. Whenever I use unwrap in some tiny little not important thing I always treat it as a temporary thing that I need to come back and fix before the software is actually ready for anyone to seriously use
There’s nothing more permanent than a “temporary” fix.
Yeah but man, they should have had a CI against this. And reviews! I have refused to merge PRs from friends on hobby projects for less than that
PM: Listen it’s almost December, the whole team decided to cash in PTO next week for thanksgiving, it’s 4pm on a Friday, and the quarter is about to end. We have to move onto next quarter’s OKRs. Is this good enough to ship?
A very tired dev: …lgtm
Other than permanent fixes
I swear some of these commenters will jerk each other off about how “Rust is bad, actually” even if the root cause of an issue was someone intentionally crashing their app. Where do you even get this kind of attitude from? I’ve been around when Rust was the popular topic in any programming-related discussions and while there was plenty of evangelism and CS-101 experts making wild claims, nothing warrants this kind of irrational hatred. I thought you need to go to the phoronix forums to find people who have such loud opinions with very little actual programming experience, but apparently I was wrong.
I feel like I’ve seen an insane number of error messages in various apps and websites around the
unwrapmethod.But this is on a result type, right? I’d figure the point would be that you would match on it and that the unwrap itself, which if my assumptions are correct, is more like
get value or throw, should either not exist or take a default value. You shouldn’t be able to directly get the value of a monad.There are good reasons to have unwrap or at least expect. There is no reason to use it in the case that Cloudflare used it in.
Rust has exceptions? Is that new?
Well… catch_unwind, but i don’t think you can rely on it.
Remember kids, always use try catch
RUST AGAIN.
Just throwing this out because I’ve been hammering this Rustholes up and down these threads who claim it’s precious and beyond compare 🤣
I will almost certainly link back to this comment in the future.
Ift is precious and beyond compare. It has tools that most other languages lack to prove certain classes of bugs are impossible.
You can still introduce bugs, especially when you use certain features that “standard” linter (clippy) catches by default and no team would silence globally.
.unwrap()is very controversial in Rust and should never be used without clear justification in production code. Even in my pet projects, it’s the first thing I clear out once basic functionality is there.This issue should’ve been caught at three separate stages:
- git pre-commit or pre-push should run the linter on the devs machine
- Static analysis checks should catch this both before getting reviews and when deploying the change
- Human code review
The fact that it made it past all three makes me very concerned about how they do development over there. We’re a much smaller company and we’re not even a software company (software dev is <1% of the total company), and we do this. We don’t even use Rust, we’re a Python shop, yet we have robust static analysis for every change. It’s standard, and any company doing anything more than a small in-house tool used by 3 people should have these standards in place.
Programmer explicitly bypasses code safety with
unwrap.
Let’s blame it on their programming language!Cool hot take, brah.
RUST AGAIN.
You took this right out of my mouth.







