From a93d902f7ab474cd0d7e5fb2c22d131b4aedb03b Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 4 Apr 2021 16:36:25 +0200 Subject: Remove AsyncDag::get_next() This interface is not particularly useful. Hence remove it. Signed-off-by: Matthias Beyer --- src/async_dag.rs | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/src/async_dag.rs b/src/async_dag.rs index 1566e72..7de8d4f 100644 --- a/src/async_dag.rs +++ b/src/async_dag.rs @@ -65,29 +65,6 @@ impl AsyncDag }) } - pub async fn get_next(&self, id: Id) -> Result> { - self.backend - .get(id) - .await? - .map(|tpl| tpl.1) - .ok_or_else(|| anyhow!("ID Not found"))? - .parent_ids() - .into_iter() - .map(|id| async move { - self.backend - .get(id) - .await - .transpose() - }) - .collect::>() - .collect::>() - .await - .into_iter() - .filter_map(|o| o) - .map(|r| r.map(|tpl| tpl.1)) - .collect() - } - /// Iterate over the DAG /// /// This function returns a Stream over all nodes in the DAG. @@ -264,18 +241,6 @@ mod tests { let has_id = has_id.unwrap(); assert!(has_id); } - - { - let next = tokio_test::block_on(dag.get_next(test::Id(1))); - assert!(next.is_ok()); - let mut next = next.unwrap(); - assert_eq!(next.len(), 1); - let node = next.pop(); - assert!(node.is_some()); - let node = node.unwrap(); - assert_eq!(node.data, 0); - assert!(node.parents.is_empty()); - } } #[test] -- cgit v1.2.3