Skip to content

Commit

Permalink
Unwrap errors on drop, prevent clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
keirlawson committed Dec 3, 2023
1 parent 2934ed3 commit 3e6c0b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/touch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub struct TouchPadDriver<T>
where
T: BorrowMut<TouchDriver>,
{
touch: T,
_touch: T,
pad: TouchPad,
}

Expand All @@ -96,7 +96,7 @@ impl TouchPadDriver<TouchDriver> {
let mut touch = TouchDriver::new(config)?;
esp!(unsafe { touch_pad_config(pad.into()) })?;
touch.start()?;
Ok(Self { touch, pad })
Ok(Self { _touch: touch, pad })
}
}

Expand Down Expand Up @@ -134,6 +134,6 @@ impl TouchDriver {
#[cfg(any(esp32, esp32s2, esp32s3))]
impl Drop for TouchDriver {
fn drop(&mut self) {
unsafe { touch_pad_fsm_stop() };
esp!(unsafe { touch_pad_fsm_stop() }).unwrap()
}
}

0 comments on commit 3e6c0b1

Please sign in to comment.