Depend on futures-util instead of futures

This commit is contained in:
TechnoPorg committed 2026-02-11 22:44:01 +01:00
1 parent f342e33f16
commit a75defa5a6
79 files changed
+447 -380

No files matched your search

+5 -5
View File
@@ -2,7 +2,7 @@
use crate::common::task_fn;
use dagx::{task, DagResult, DagRunner, TaskHandle};
use futures::FutureExt;
use std::sync::{Arc, Mutex};
#[tokio::test]
@@ -79,7 +79,7 @@ async fn test_dependency_resolution_order() -> DagResult<()> {
.depends_on(d)
};
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap)).await?;
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() }).await?;
assert_eq!(dag.get(e)?, 5);
@@ -113,7 +113,7 @@ async fn test_transitive_dependencies() -> DagResult<()> {
.add_task(task_fn::<i32, _, _>(|&x: &i32| x + 5))
.depends_on(b);
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap)).await?;
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() }).await?;
assert_eq!(dag.get(a)?, 10);
assert_eq!(dag.get(b)?, 20);
@@ -136,7 +136,7 @@ async fn test_deep_chain_50_levels() -> DagResult<()> {
handles.push(next);
}
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap)).await?;
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() }).await?;
assert_eq!(dag.get(handles.last().unwrap())?, 50);
Ok(())
@@ -155,7 +155,7 @@ async fn test_deep_chain_200_levels() -> DagResult<()> {
.depends_on(current);
}
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap)).await?;
dag.run(|fut| async move { tokio::spawn(fut).await.unwrap() }).await?;
assert_eq!(dag.get(current)?, 201);
Ok(())