diff --git a/lading_payload/src/dogstatsd.rs b/lading_payload/src/dogstatsd.rs index a8711fa59d..1206920a88 100644 --- a/lading_payload/src/dogstatsd.rs +++ b/lading_payload/src/dogstatsd.rs @@ -28,13 +28,7 @@ fn contexts_maximum() -> u32 { } fn value_config() -> ValueConf { - ValueConf { - float_probability: 0.5, // 50% - range: ValueRange::Inclusive { - min: i64::MIN, - max: i64::MAX, - }, - } + ValueConf::default() } // https://docs.datadoghq.com/developers/guide/what-best-practices-are-recommended-for-naming-metrics-and-tags/#rules-and-best-practices-for-naming-metrics @@ -136,6 +130,18 @@ pub struct ValueConf { range: ValueRange, } +impl Default for ValueConf { + fn default() -> Self { + Self { + float_probability: 0.5, // 50% + range: ValueRange::Inclusive { + min: i64::MIN, + max: i64::MAX, + }, + } + } +} + /// Configuration for the values range of a metric. #[derive(Debug, Deserialize, Clone, PartialEq, Copy)] #[serde(rename_all = "snake_case")]