From a999413553c732f212b6907cbdfe5eab11f30bcb Mon Sep 17 00:00:00 2001 From: Raul Victor Trombin Date: Fri, 15 Sep 2023 18:01:55 -0300 Subject: [PATCH] src: lib: Add derive:default for SensorData and inner structures --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4a978df015..f83aea0806 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -116,7 +116,7 @@ pub enum PwmChannel { } /// The `AxisData` struct encapsulate values for the x, y, and z axes. -#[derive(Debug)] +#[derive(Debug, Default)] pub struct AxisData { pub x: f32, pub y: f32, @@ -124,13 +124,13 @@ pub struct AxisData { } /// Encapsulates the value of ADC's four channels. -#[derive(Debug)] +#[derive(Debug, Default)] pub struct ADCData { pub channel: [f32; 4], } /// Encapsulates the value of all sensors on the board. -#[derive(Debug)] +#[derive(Debug, Default)] pub struct SensorData { pub adc: ADCData, pub temperature: f32,