default-ext

Crates.iodefault-ext
lib.rsdefault-ext
version0.1.0
sourcesrc
created_at2020-11-08 18:19:45.203859
updated_at2020-11-08 18:19:45.203859
descriptionThis library provides extension methods for the `Default` trait.
homepage
repositoryhttps://github.com/mechiru/default-ext
max_upload_size
id309992
size15,838
(mechiru)

documentation

https://docs.rs/default-ext

README

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.

Commit count: 3

cargo fmt