mechiru / default-ext

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

default-ext

ci Rust Documentation Latest Version

This library provides extension methods for the Default trait.

Example

case1:

use default_ext::DefaultExt;
assert!(false.is_default());

case2:

#[derive(serde::Serialize, serde::Deserialize)]
struct Object {
    #[serde(
        default,
        skip_serializing_if = "default_ext::DefaultExt::is_default",
    )]
    is_test: bool,
}

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

About

License:Apache License 2.0


Languages

Language:Rust 100.0%