Add an example of constructing a unit-like struct.

This was non-obvious to me: with no example, I assumed `Electron {}` and
didn't know what else to try when it didn't work.  The correct form is
weird because it looks like you're assigning the struct name rather than
an instance of the struct.
This commit is contained in:
Xavier Shay 2015-09-26 11:59:00 -07:00
parent 9169e6c53c
commit 3885a81e5f

View File

@ -184,6 +184,8 @@ You can define a `struct` with no members at all:
```rust
struct Electron;
let x = Electron;
```
Such a `struct` is called unit-like because it resembles the empty