summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-04-04 16:36:25 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-04-04 16:36:27 +0200
commita93d902f7ab474cd0d7e5fb2c22d131b4aedb03b (patch)
tree1dfbc8e8b0e23f6577c19880a471a7a626e55288
parent3bcfe28b7984a14e468ffaa821f127941f9494c4 (diff)
Remove AsyncDag::get_next()
This interface is not particularly useful. Hence remove it. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--src/async_dag.rs35
1 files changed, 0 insertions, 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<Id, N, Backend> AsyncDag<Id, N, Backend>
})
}
- pub async fn get_next(&self, id: Id) -> Result<Vec<N>> {
- 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::<futures::stream::FuturesUnordered<_>>()
- .collect::<Vec<_>>()
- .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]