Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
danieldk
on Oct 19, 2012
|
parent
|
context
|
favorite
| on:
Such a Little Thing: The Semicolon in Rust
Then you need an algebraic data type having nil is one of its constructors, and that function returning that type.
AFAIK, Rust doesn't have nil. So, the closest thing is using the option type.
kibwen
on Oct 19, 2012
[–]
In Rust, nil is the name for the unit type (written as empty parentheses, like "()"), used whenever a function doesn't return anything meaningful. You're correct in that instead of null pointers it has the None variant of the Option enum.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
AFAIK, Rust doesn't have nil. So, the closest thing is using the option type.