deserialize_decimal_or_zero

Function deserialize_decimal_or_zero 

Source
pub fn deserialize_decimal_or_zero<'de, D>(
    deserializer: D,
) -> Result<Decimal, D::Error>
where D: Deserializer<'de>,
Expand description

Deserializes a Decimal from a string field that might be empty. Handles Bybit’s edge case where empty string “” becomes Decimal::ZERO.