-
-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
I'm not sure if this would be possible in typescript.
In addition to match, rust also has if let Some(X) = an_opt_var { ....
This is really useful, since often the None case isn't used / ignored.
It's possible to do if (opt.isSome()) { let x = opt.unwrap()... but that's less compiler-checked, and it requires an unsafe unwrap.
I'd like this a lot since my lemmy-ui codebase has tons of these verbose .match whilst ignoring the none case, all over the code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels