Skip to content

Commit

Permalink
Fix clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Jul 5, 2023
1 parent f397635 commit 2f52047
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ where
}
}

pub fn subscribe(&mut self, callback: impl Fn() + 'static) {
pub fn subscribe(&mut self, callback: impl Fn() + Send + 'static) {
let mut guard = self.pins.lock().unwrap();

guard[self.id as usize].shared.callback = Some(Box::new(callback));
Expand Down Expand Up @@ -334,7 +334,7 @@ pub struct SharedPin {
meta: PinMeta,
value: PinValue,
dropped: bool,
callback: Option<Box<dyn Fn()>>,
callback: Option<Box<dyn Fn() + Send>>,
}

impl SharedPin {
Expand Down
3 changes: 2 additions & 1 deletion src/ui/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ mod local {

pub fn send<M>(sender: impl Into<channel::DynamicSender<'static, M>>) -> impl Fn(M)
where
M: Debug + 'static,
M: Debug + Send + 'static,
{
#[allow(clippy::arc_with_non_send_sync)]
let sender = Arc::new(Mutex::<CriticalSectionRawMutex, _>::new(sender.into()));

move |msg| {
Expand Down

0 comments on commit 2f52047

Please sign in to comment.