fix nightly builds

* update proc-macro2
* fix new warnings
This commit is contained in:
extrawurst 2023-07-07 15:46:32 +02:00
parent 05ce018e06
commit cb9cf3ad0c
3 changed files with 16 additions and 5 deletions

4
Cargo.lock generated
View File

@ -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",
]

View File

@ -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;

View File

@ -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<T> {
pub struct NotifyableMutex<T>
where
T: Send + Sync,
{
data: Arc<(Mutex<T>, Condvar)>,
}
impl<T> NotifyableMutex<T> {
impl<T> NotifyableMutex<T>
where
T: Send + Sync,
{
///
pub fn new(start_value: T) -> Self {
Self {
@ -23,6 +29,7 @@ impl<T> NotifyableMutex<T> {
while *data != condition {
data = self.data.1.wait(data).expect("wait err");
}
drop(data);
}
///