cuprate/net/monero-wire/src/serde_helpers.rs
2023-10-15 20:35:33 +01:00

15 lines
273 B
Rust

use std::fmt::Debug;
pub(crate) fn default_false() -> bool {
false
}
pub(crate) fn default_true() -> bool {
true
}
pub(crate) fn default_zero<T: TryFrom<u8>>() -> T {
0.try_into()
.map_err(|_| "Couldn't fit 0 into integer type!")
.unwrap()
}