Re:From Rust to TypeScript
by steveklabnik on Saturday September 12, 2020 @11:55AM
(#24453345)
In Rust, your code would look like this:
(This wouldn't compile because you don't actually return anything in the success case, but I just kept the code the same. Additionally, I am assuming you are using some sort of crate that helps with error type mapping, because that's realistic, otherwise, it would be Result<i32, Error> where Error would be some sort of type mapping to SomeException's type.)
[ Parent
| on HN ]
There are no comments on this comment yet.