Skip to content

Commit 6589887

Browse files
committed
Help untagged users know of performance issues and fix them
Inspired by serde-rs/serde#2101
1 parent 19185a8 commit 6589887

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

_src/container-attrs.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@
7272

7373
When no variant matches, the error may be uninformative which can be improved with [`serde(expecting)`](#expecting).
7474

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+
7580
- ##### `#[serde(bound = "T: MyTrait")]` {#bound}
7681

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

0 commit comments

Comments
 (0)