From 9f1c88b863e247da3cd60d2792a7a13b18e25e53 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Wed, 14 Dec 2022 23:48:22 +0800 Subject: a temporary check point just to save things in a commit --- graph/src/adlist.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'graph/src/adlist.rs') diff --git a/graph/src/adlist.rs b/graph/src/adlist.rs index c16ceb2..18ad770 100644 --- a/graph/src/adlist.rs +++ b/graph/src/adlist.rs @@ -102,6 +102,14 @@ impl ExtGraph for ALGraph { } } +// TODO: Add a way to build a graph by its raw adjacency list representation. +impl From>> for ALGraph { + fn from(adlist: Vec>) -> Self { + let nodes: Vec = adlist.iter().cloned().map(ALNode::new).collect(); + Self { nodes } + } +} + #[cfg(test)] mod algraph_test { use super::*; -- cgit v1.2.3-18-g5258