We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56f24d7 commit 74e9629Copy full SHA for 74e9629
src/doc/book/structs.md
@@ -234,9 +234,12 @@ rather than positions.
234
You can define a `struct` with no members at all:
235
236
```rust
237
-struct Electron {}
+struct Electron {} // use empty braces...
238
+struct Proton; // ...or just a semicolon
239
240
+// whether you declared the struct with braces or not, do the same when creating one
241
let x = Electron {};
242
+let y = Proton;
243
```
244
245
Such a `struct` is called ‘unit-like’ because it resembles the empty
0 commit comments