| ▲ | vsgherzi 3 hours ago | |||||||||||||
Why does cloudflare allow unwraps in their code? I would've assumed they'd have clippy lints stopping that sort of thing. Why not just match with { ok(value) => {}, Err(error) => {} } the function already has a Result type. At the bare minimum they could've used an expect("this should never happen, if it does database schema is incorrect"). The whole point of errors as values is preventing this kind of thing.... It wouldn't have stopped the outage but it would've made it easy to diagnose. If anyone at cloudflare is here please let me in that codebase :) | ||||||||||||||
| ▲ | waterTanuki 3 hours ago | parent [-] | |||||||||||||
Not a cloudflare employee but I do write a lot of Rust. The amount of things that can go wrong with any code that needs to make a network call is staggeringly high. unwrap() is normal during development phase but there are a number of times I leave an expect() for production because sometimes there's no way to move forward. | ||||||||||||||
| ||||||||||||||