From ea222793caca37b06313e9743ddb19816e00c6d5 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Wed, 25 Dec 2024 01:53:21 +0100 Subject: [PATCH] Remove unused pin from null driver --- src/drivers/null.rs | 8 +++----- src/settings.rs | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/drivers/null.rs b/src/drivers/null.rs index 1e8e2c2..c44b1a3 100644 --- a/src/drivers/null.rs +++ b/src/drivers/null.rs @@ -1,13 +1,11 @@ use crate::drivers::RelayDriver; use crate::errors::EmgauwaControllerError; -pub struct NullDriver { - pub pin: u8, -} +pub struct NullDriver {} impl NullDriver { - pub fn new(pin: u8) -> Self { - Self { pin } + pub fn new() -> Self { + Self {} } } diff --git a/src/settings.rs b/src/settings.rs index b812ab0..fdf3c54 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -96,7 +96,7 @@ impl Relay { state: bool, ) -> Result, EmgauwaError> { let mut driver: Box = match self.driver { - drivers::Driver::Null => Box::new(drivers::NullDriver::new(self.pin)), + drivers::Driver::Null => Box::new(drivers::NullDriver::new()), drivers::Driver::Gpio => Box::new(drivers::GpioDriver::new(self.pin, self.inverted)?), drivers::Driver::PiFace => { if pfd.is_none() {