From a3a894830f5122be1efb072dc6b41df9324d199a Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Tue, 13 Aug 2024 15:58:48 +0800 Subject: [PATCH] update Reademe --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a294675..8d3c293 100644 --- a/README.md +++ b/README.md @@ -93,9 +93,10 @@ This crate also includes the following optional features: - `std`(optional): - `box`: implements the `Patch>` trait for `T` where `T` implements `Patch

`. This let you patch a boxed (or not) struct with a boxed patch. - - `option`: implements the `Patch>` trait for `Option` where `T` implements `Patch

`. - `T` also needs to implement `From

`. - This let you patch structs containing fields with optional values. + - `option`: implements the `Patch>` trait for `Option` where `T` implements `Patch

`, please take a look at the example to learn more. + - default: `T` also needs to implement `From

`. When patching on None, it will based on `from

` 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