Skip to content

Commit 25d147c

Browse files
committed
Reorder identifier attrs
1 parent f006ea9 commit 25d147c

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

_src/container-attrs.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,6 @@
7070
Use the untagged enum representation for this enum. See [enum representations]
7171
for details on this representation.
7272

73-
- ##### `#[serde(variant_identifier)]` {#variant_identifier}
74-
75-
Use an identifier representation for this enum. This can only be applied to
76-
enums that are C-like (containing only unit variants), and forces them to
77-
always be represented as strings, regardless of the underlying data format's
78-
representation of enums.
79-
80-
- ##### `#[serde(field_identifier)]` {#field_identifier}
81-
82-
Identical to [`variant_identifier`], but also allows for the last variant to
83-
be a newtype variant, which will be used if none of the other variants match
84-
(similar to [`#[serde(other)]`]). Like `variant_identifier`, this forces the
85-
enum to always be represented as a string, regardless of the underlying data
86-
format's representation of enums.
87-
88-
[`variant_identifier`]: #variant_identifier
89-
[`#[serde(other)`]: variant-attrs.md#other
90-
9173
- ##### `#[serde(bound = "T: MyTrait")]` {#bound}
9274

9375
Where-clause for the `Serialize` and `Deserialize` impls. This replaces any
@@ -153,3 +135,21 @@
153135
Specify a custom type expectation text for deserialization error messages.
154136
This is used by the generated `expecting` method for the container `Visitor`,
155137
and as a fallthrough error message for untagged enums.
138+
139+
- ##### `#[serde(variant_identifier)]` {#variant_identifier}
140+
141+
Use an identifier representation for this enum. This can only be applied to
142+
enums that are C-like (containing only unit variants), and forces them to
143+
always be represented as strings, regardless of the underlying data format's
144+
representation of enums.
145+
146+
- ##### `#[serde(field_identifier)]` {#field_identifier}
147+
148+
Identical to [`variant_identifier`], but also allows for the last variant to
149+
be a newtype variant, which will be used if none of the other variants match
150+
(similar to [`#[serde(other)]`]). Like `variant_identifier`, this forces the
151+
enum to always be represented as a string, regardless of the underlying data
152+
format's representation of enums.
153+
154+
[`variant_identifier`]: #variant_identifier
155+
[`#[serde(other)`]: variant-attrs.md#other

0 commit comments

Comments
 (0)