Skip to content

Commit 3668e63

Browse files
authored
Merge pull request #156 from epage/untagged
Help improve experience with untagged schemas
2 parents 93377b1 + 6589887 commit 3668e63

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

_src/container-attrs.md

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

73+
When no variant matches, the error may be uninformative which can be improved with [`serde(expecting)`](#expecting).
74+
75+
In performance-critical code, checking each variant and processing the errors can be slow.
76+
In these cases, it may be better to hand-implement the deserialize trait for which [serde-untagged] may help.
77+
78+
[serde-untagged]: https://docs.rs/serde-untagged
79+
7380
- ##### `#[serde(bound = "T: MyTrait")]` {#bound}
7481

7582
Where-clause for the `Serialize` and `Deserialize` impls. This replaces any

0 commit comments

Comments
 (0)