Re:Asciinema 3.0 will be rewritten in Rust
by winrid on Thursday February 08, 2024 @03:52PM
(#39307537)
no I would just do what makes sense to me, which is what I commented. you can do exceptions or type the return values. sounds like you want to do the latter. handling it isn't as nice as in rust though, I agree. You could create a simple object to emulate it though like "ReturnValue { unwrap: fn, ifOk: fn, ifErr: fn } " where unwrap throws if invalid, ifOk returns true if the response is valid, and ifErr returns true if an err.
[ Parent
| on HN ]