diff --git a/lading_payload/src/dogstatsd.rs b/lading_payload/src/dogstatsd.rs index 996768d26..1c303a52d 100644 --- a/lading_payload/src/dogstatsd.rs +++ b/lading_payload/src/dogstatsd.rs @@ -32,13 +32,7 @@ fn contexts() -> ConfRange { } fn value_config() -> ValueConf { - ValueConf { - float_probability: 0.5, // 50% - range: ConfRange::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 @@ -120,6 +114,17 @@ pub struct ValueConf { range: ConfRange, } +impl Default for ValueConf { + fn default() -> Self { + Self { + float_probability: 0.5, // 50% + range: ConfRange::Inclusive { + min: i64::MIN, + max: i64::MAX, + }, + } + } +} /// Range expression for configuration #[derive(Debug, Deserialize, Clone, PartialEq, Copy)] #[serde(rename_all = "snake_case")]