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

Ahh, I remember what it was. I saw a code snippet like this:

    let input = reader.read_line().ok().expect("Failed to read line");
And I thought "Cool, Rust has exceptions!"

I'm probably too used to thinking in Python. Or maybe I'm just dyslexic and I read "expect()" as "except()".

Either way, your comment prompted me to dig into it further and find out how Rust actually handles errors. So, thanks!



Thanks for elaborating! I wrote that line in the docs, actually. I wonder if I should add an explicit note about exceptions not being a thing.




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

Search: