serde-util 0.1.0

Soni's Serde Utilities
Documentation

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:

{
  "bar": []
}

to successfully deserialize into the Rust struct:

#[derive(Deserialize)]
struct Foo {
  bar: MayBe<f64>,
}

as a foo.bar.is_none().