Skip to content

Commit b237d12

Browse files
authored
Rename C-like enum to Field-less enum
There is no need to reference the C programming language to explain this concept.
1 parent 857f2c9 commit b237d12

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/items/enumerations.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ In this example, `Cat` is a _struct-like enum variant_, whereas `Dog` is simply
3636
called an enum variant. Each enum instance has a _discriminant_ which is an
3737
integer associated to it that is used to determine which variant it holds.
3838

39-
## C-like Enumerations
39+
## Custom Discriminant Values for Field-Less Enumerations
4040

41-
If there is no data attached to *any* of the variants of an enumeration it is
42-
called a *c-like enumeration*. If a discriminant isn't specified, they start at
43-
zero, and add one for each variant, in order. Each enum value is just its
44-
discriminant which you can specify explicitly:
41+
If there is no data attached to *any* of the variants of an enumeration,
42+
then the discriminant can directly chosen and accessed.
43+
44+
If a discriminant isn't specified, they start at zero, and add one for each
45+
variant, in order. Each enum value is just its discriminant which you can
46+
specify explicitly:
4547

4648
```rust
4749
enum Foo {
@@ -58,7 +60,7 @@ hand side and specify the memory layout.
5860

5961
[`repr` attribute]: attributes.html#ffi-attributes
6062

61-
You can also cast a c-like enum to get its discriminant:
63+
You can also cast a field-less enum to get its discriminant:
6264

6365
```rust
6466
# enum Foo { Baz = 123 }

0 commit comments

Comments
 (0)