Skip to content

Commit

Permalink
show both forms of empty struct declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
durka committed Jul 5, 2016
1 parent 56f24d7 commit 74e9629
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/doc/book/structs.md
Expand Up @@ -234,9 +234,12 @@ rather than positions.
You can define a `struct` with no members at all:

```rust
struct Electron {}
struct Electron {} // use empty braces...
struct Proton; // ...or just a semicolon

// whether you declared the struct with braces or not, do the same when creating one
let x = Electron {};
let y = Proton;
```

Such a `struct` is called ‘unit-like’ because it resembles the empty
Expand Down

0 comments on commit 74e9629

Please sign in to comment.