distant_protocol/utils.rs
1/// Used purely for skipping serialization of values that are false by default.
2#[inline]
3pub const fn is_false(value: &bool) -> bool {
4 !*value
5}
6
7/// Used purely for skipping serialization of values that are 1 by default.
8#[inline]
9pub const fn is_one(value: &usize) -> bool {
10 *value == 1
11}
12
13/// Used to provide a default serde value of 1.
14#[inline]
15pub const fn one() -> usize {
16 1
17}