Thread with 3 posts
jump to expanded postrust's
let Some(unwrapped) = thing_that_might_fail() else {
return Err("thing went wrong");
};
is the best thing since sliced bread i miss it dearly every time i write c or c++
it's funny how much i say this because sliced bread kinda sucks ngl
what's even the point of having optionals in c++ if the only realistic way to use them involves the same ub-hazard code patterns as in c. every single rust feature that is shared with c++ is just straight up more useful and more usable and less pointless in its rust incarnation