Skip to content

Commit 9c1c61c

Browse files
authored
Explicit unnamed member example
1 parent 87dd8df commit 9c1c61c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

url_serde/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ struct MyStruct {
2727
}
2828
```
2929
30+
# How do I use a data type with an unnamed `Url` member with serde?
31+
32+
Same problem, same solution.
33+
34+
```
35+
#[derive(serde::Serialize, serde::Deserialize)]
36+
enum MyEnum {
37+
A(#[serde(with = "url_serde")] Url, OtherType),
38+
}
39+
```
40+
3041
# How do I encode a `Url` value with `serde_json::to_string`?
3142
3243
Use the `Ser` wrapper.

0 commit comments

Comments
 (0)