Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Result is not a core concept in Rust.

If you don't see std::result::Result as a core concept in Rust, which might be fair, one can still argue that it _should_ be a core concept, given its ubiquitous usage.



You misquoted, I never said Result is not a core concept.

What I said is that “A function returns Result” in the universal sense (that is, everything that is a function returns Result) is not a core concept in Rust.

Some functions return Result<T,E> for some <T,E>. Some functions return Option<T> for some T. Some functions have no reason to use that kind of generic wrapper type (a pure function that handles any value in its range and returns a valid value in a simple type for each doesn't need either; Option/Result are typically needed with otherwise non-total functions or functions that perform side effects that can fail.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: