summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crates/core/tedge_lib/src/measurement.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/core/tedge_lib/src/measurement.rs b/crates/core/tedge_lib/src/measurement.rs
index 9c68fbc2..0b760c88 100644
--- a/crates/core/tedge_lib/src/measurement.rs
+++ b/crates/core/tedge_lib/src/measurement.rs
@@ -8,10 +8,7 @@ pub struct Measurement {
impl Measurement {
pub const fn new(name: String, value: MeasurementValue) -> Self {
- Self {
- name,
- value
- }
+ Self { name, value }
}
/// Get a reference to the measurement's name.
@@ -31,11 +28,11 @@ impl tedge_api::plugin::Message for Measurement {
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
+#[serde(untagged)]
pub enum MeasurementValue {
Bool(bool),
Float(f64),
Text(String),
List(Vec<MeasurementValue>),
- Map(HashMap<String, MeasurementValue>)
+ Map(HashMap<String, MeasurementValue>),
}
-