You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
distant/distant-protocol/src/utils.rs

18 lines
397 B
Rust

/// Used purely for skipping serialization of values that are false by default.
#[inline]
pub const fn is_false(value: &bool) -> bool {
!*value
}
/// Used purely for skipping serialization of values that are 1 by default.
#[inline]
pub const fn is_one(value: &usize) -> bool {
*value == 1
}
/// Used to provide a default serde value of 1.
#[inline]
pub const fn one() -> usize {
1
}