mirror of
https://github.com/bytedream/serde-inline-default.git
synced 2025-05-09 04:05:12 +02:00
chore: highlight required the macro position even more
This commit is contained in:
parent
85b1fbdfcd
commit
cbd26efdd4
@ -19,7 +19,7 @@ fn value_default() -> u32 { 42 }
|
||||
|
||||
That can get quiet messy if you have many fields with many (different) default values.
|
||||
This crate tries to solve this issue by providing the `#[serde_inline_default]` proc macro.
|
||||
With this macro set at the struct level (_before `#[derive(Deserialize)]`/`#[derive(Serialize)]`!_, otherwise it's not working correctly), you can set default values via `#[serde_inline_default(...)]` for your serde fields inline, without creating an extra function.
|
||||
With this macro set at the struct level (_**before `#[derive(Deserialize)]`/`#[derive(Serialize)]`!, otherwise it's not working correctly**_), you can set default values via `#[serde_inline_default(...)]` for your serde fields inline, without creating an extra function.
|
||||
|
||||
```rust
|
||||
#[serde_inline_default]
|
||||
|
Loading…
x
Reference in New Issue
Block a user