Skip to content

Commit 677cf17

Browse files
authored
List serde(rename) limitation to valid Rust identifiers
1 parent b095571 commit 677cf17

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ fn main() {
176176

177177
## Limitations
178178

179+
RON requires struct, enum, and variant names to be valid Rust identifiers and will reject invalid ones created by `#[serde(rename = "...")]` at serialization / deserialization time.
180+
179181
RON is not designed to be a fully self-describing format (unlike JSON) and is thus not guaranteed to work when [`deserialize_any`](https://docs.rs/serde/latest/serde/trait.Deserializer.html#tymethod.deserialize_any) is used instead of its typed alternatives. In particular, the following Serde attributes only have limited support:
180182

181183
- `#[serde(tag = "tag")]`, i.e. internally tagged enums [^serde-enum-hack]

0 commit comments

Comments
 (0)