Skip to content

Commit

Permalink
Derive Debug, Clone and Copy for settings
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelbuesing committed Oct 31, 2024
1 parent 0404a50 commit 838d1ea
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,18 @@ impl Clone for GasSett {
}

/// Stores gas and temperature settings
#[derive(Debug, Default, Copy)]
#[derive(Debug, Default, Clone, Copy)]
pub struct SensorSettings {
/// Gas settings
pub gas_sett: GasSett,
/// Temperature settings
pub tph_sett: TphSett,
}

impl Clone for SensorSettings {
fn clone(&self) -> Self {
*self
}
}

bitflags! {
/// Flags that determine what settings are to be set and what settings are to be read.
/// Use the `SettingsBuilder` to initialize an instance when setting the settings.
#[derive(Default)]
#[derive(Debug, Default, Clone, Copy)]
pub struct DesiredSensorSettings: u16 {
/// To set temperature oversampling
const OST_SEL = 1;
Expand Down Expand Up @@ -161,7 +155,7 @@ bitflags! {
/// .with_run_gas(true)
/// .build();
/// ```
#[derive(Default)]
#[derive(Debug, Default, Clone, Copy)]
pub struct SettingsBuilder {
desired_settings: DesiredSensorSettings,
sensor_settings: SensorSettings,
Expand Down

0 comments on commit 838d1ea

Please sign in to comment.