Crates.io | is_empty |
lib.rs | is_empty |
version | 0.3.0 |
source | src |
created_at | 2023-01-19 15:23:05.572485 |
updated_at | 2024-11-09 13:28:06.344417 |
description | Easily check if the struct is empty. |
homepage | |
repository | https://github.com/puilp0502/is_empty |
max_upload_size | |
id | 762647 |
size | 13,536 |
Easily check if the struct is empty.
use is_empty::IsEmpty;
#[derive(IsEmpty)]
struct Foo {
a: Option<String>,
b: Option<String>,
}
let foo = Foo {
a: Some("a".to_string()),
b: None,
};
assert!(!foo.is_empty());
let bar = Foo {
a: None,
b: None,
};
assert!(bar.is_empty());
This crate was made possible by the excellent blog series on derive macros by Jonas Platte.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.