Skip to content

Commit

Permalink
update Reademe
Browse files Browse the repository at this point in the history
  • Loading branch information
yanganto committed Aug 13, 2024
1 parent eeeaa4a commit a3a8948
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ This crate also includes the following optional features:
- `std`(optional):
- `box`: implements the `Patch<Box<P>>` trait for `T` where `T` implements `Patch<P>`.
This let you patch a boxed (or not) struct with a boxed patch.
- `option`: implements the `Patch<Option<P>>` trait for `Option<T>` where `T` implements `Patch<P>`.
`T` also needs to implement `From<P>`.
This let you patch structs containing fields with optional values.
- `option`: implements the `Patch<Option<P>>` trait for `Option<T>` where `T` implements `Patch<P>`, please take a look at the example to learn more.
- default: `T` also needs to implement `From<P>`. When patching on None, it will based on `from<P>` to cast T, and this let you patch structs containing fields with optional values.
- `none_as_default`: `T` also needs to implement `Default`. When patching on None, it will patch on a default instance, and this also let you patch structs containing fields with optional values.
- `keep_none`: When patching on None, it is still None.

[crates-badge]: https://img.shields.io/crates/v/struct-patch.svg
[crate-url]: https://crates.io/crates/struct-patch
Expand Down

0 comments on commit a3a8948

Please sign in to comment.