Skip to main content

utils/
serde_helpers.rs

1/// Serde `skip_serializing_if` helper for `bool` fields that default to `false`.
2///
3/// Takes `&bool` rather than `bool` because `skip_serializing_if` calls the
4/// predicate with a reference to the field.
5#[allow(clippy::trivially_copy_pass_by_ref)]
6pub fn is_false(b: &bool) -> bool {
7    !*b
8}