diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2021-09-16 10:51:39 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2021-09-16 10:51:39 -0300 |
commit | 134727652dc3a65bc5cf6a4d3cfb1c24fd023d5e (patch) | |
tree | af84264ada4c309cbf78a48e9030748a7ecac110 /README.md |
[Project] Soni's Serde Utilities
Some utilities for use with serde.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..2a0dd34 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +Soni's Serde Utilities +====================== + +This crate provides some utilities for use with serde. + +Currently, it provides `MayBe<T>`, an `Option<T>`-like that doesn't error if +something is present but doesn't match a `T`. For example, it enables the JSON: + +```json +{ + "bar": [] +} +``` + +to successfully deserialize into the Rust struct: + +```rust +#[derive(Deserialize)] +struct Foo { + bar: MayBe<f64>, +} +``` + +as a `foo.bar.is_none()`. |