3 ms·
I like the idea of TypeScript-like error handling. Or more generally, functions that can return different types without having to define an `enums`. If only be
by jedisct1 7y ago
I like the idea of TypeScript-like error handling.
Or more generally, functions that can return different types without having to define an `enums`. If only because naming these single-use `enums` is hard :)
- epage 7y agoIs it employing anonymous enums? They come up for helping errors in the Rust community from time to time. The main dropback I see on relying on them is that they make it easy to accidentally expose your implementation details as part of your public API, making it a breaking change to upgrade or change a dependency.
- The_rationalist 7y agoIn typescript you can return union types. Rust doesn't allow that, at least not ergonomically.