From cb9cf3ad0c0a842bebe000be1beabc4e02c83477 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Fri, 7 Jul 2023 15:46:32 +0200 Subject: [PATCH] fix nightly builds * update proc-macro2 * fix new warnings --- Cargo.lock | 4 ++-- asyncgit/src/lib.rs | 6 +++++- src/notify_mutex.rs | 11 +++++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 62baf6e0..ed93fac5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1397,9 +1397,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] diff --git a/asyncgit/src/lib.rs b/asyncgit/src/lib.rs index ecf85e0c..1eaa9973 100644 --- a/asyncgit/src/lib.rs +++ b/asyncgit/src/lib.rs @@ -22,7 +22,11 @@ //TODO: get this in someday since expect still leads us to crashes sometimes // #![deny(clippy::expect_used)] //TODO: consider cleaning some up and allow specific places -#![allow(clippy::significant_drop_tightening)] +#![allow( + clippy::significant_drop_tightening, + // TODO: + clippy::missing_panics_doc +)] pub mod asyncjob; mod blame; diff --git a/src/notify_mutex.rs b/src/notify_mutex.rs index bd5a031e..d70a5007 100644 --- a/src/notify_mutex.rs +++ b/src/notify_mutex.rs @@ -2,11 +2,17 @@ use std::sync::{Arc, Condvar, Mutex}; /// combines a `Mutex` and `Condvar` to allow waiting for a change in the variable protected by the `Mutex` #[derive(Clone, Debug)] -pub struct NotifyableMutex { +pub struct NotifyableMutex +where + T: Send + Sync, +{ data: Arc<(Mutex, Condvar)>, } -impl NotifyableMutex { +impl NotifyableMutex +where + T: Send + Sync, +{ /// pub fn new(start_value: T) -> Self { Self { @@ -23,6 +29,7 @@ impl NotifyableMutex { while *data != condition { data = self.data.1.wait(data).expect("wait err"); } + drop(data); } ///