fix: CI issues under Darwin

This commit is contained in:
Karolin Varner
2024-12-09 15:35:34 +01:00
committed by Paul Spooren
parent df3d1821c8
commit 2d20ad6335
+6 -3
View File
@@ -1,5 +1,4 @@
use anyhow::Error; use anyhow::Error;
use futures::lock::Mutex;
use serde::Deserialize; use serde::Deserialize;
use std::future::Future; use std::future::Future;
use std::ops::DerefMut; use std::ops::DerefMut;
@@ -140,11 +139,15 @@ mod netlink {
} }
#[derive(Clone)] #[derive(Clone)]
struct CleanupHandlers(Arc<Mutex<Vec<Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>>>>); #[cfg(any(target_os = "linux", target_os = "freebsd"))]
struct CleanupHandlers(
Arc<::futures::lock::Mutex<Vec<Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>>>>,
);
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
impl CleanupHandlers { impl CleanupHandlers {
fn new() -> Self { fn new() -> Self {
CleanupHandlers(Arc::new(Mutex::new(vec![]))) CleanupHandlers(Arc::new(::futures::lock::Mutex::new(vec![])))
} }
async fn enqueue(&self, handler: Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>) { async fn enqueue(&self, handler: Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>) {