Skip to content

Commit 11f33bd

Browse files
authored
Merge pull request #157 from notriddle/patch-1
Rename C-like enum to Field-less enum
2 parents e0563de + 0828379 commit 11f33bd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/items/enumerations.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ In this example, `Cat` is a _struct-like enum variant_, whereas `Dog` is simply
6161
called an enum variant. Each enum instance has a _discriminant_ which is an
6262
integer associated to it that is used to determine which variant it holds.
6363

64-
## C-like Enumerations
64+
## Custom Discriminant Values for Field-Less Enumerations
6565

66-
If there is no data attached to *any* of the variants of an enumeration it is
67-
called a *c-like enumeration*. If a discriminant isn't specified, they start at
68-
zero, and add one for each variant, in order. Each enum value is just its
69-
discriminant which you can specify explicitly:
66+
If there is no data attached to *any* of the variants of an enumeration,
67+
then the discriminant can be directly chosen and accessed.
68+
69+
If a discriminant isn't specified, they start at zero, and add one for each
70+
variant, in order. Each enum value is just its discriminant which you can
71+
specify explicitly:
7072

7173
```rust
7274
enum Foo {
@@ -83,7 +85,7 @@ hand side and specify the memory layout.
8385

8486
[`repr` attribute]: attributes.html#ffi-attributes
8587

86-
You can also cast a c-like enum to get its discriminant:
88+
You can also cast a field-less enum to get its discriminant:
8789

8890
```rust
8991
# enum Foo { Baz = 123 }

0 commit comments

Comments
 (0)