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

Most of this is out of the scope of this tutorial, but is in the comprehensive one.

match is an expression, but let is a statement. In the first example, the match expression is used inside of the let statement, in order to produce what is assigned.

I'm not 100% sure if you _must_ take that reference, but given that it's a pointer, that makes sense. In the previous version, it's simply returning a value, but println! needs the contents, not the pointer itself.

Inside the linked Option enum, it shows both: http://static.rust-lang.org/doc/master/std/option/enum.Optio...

It's an enum like any other.

That said, these are all good points, and this documentation should be improved. Thanks, I'll add this to my list.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: