Crates.io | default-ext |
lib.rs | default-ext |
version | 0.1.0 |
source | src |
created_at | 2020-11-08 18:19:45.203859 |
updated_at | 2020-11-08 18:19:45.203859 |
description | This library provides extension methods for the `Default` trait. |
homepage | |
repository | https://github.com/mechiru/default-ext |
max_upload_size | |
id | 309992 |
size | 15,838 |
This library provides extension methods for the Default
trait.
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,
}
Licensed under either of Apache License, Version 2.0 or MIT license at your option.