diff options
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()`. |