Hacker News new | ask | show | jobs
by yarper 3671 days ago
It supports that kind of error handling too,

fn something() -> (String, String) ...

let (result, err) = something()

It's just that Result is preferable because you can pattern match on it

1 comments

That would be

    fn something() -> (Option<String>, Option<String>)
Because the Rust types aren't nullable by default. But that more clearly demonstrates that Result types are better since they enforce that the error and result are mutually exclusive.
agreed!