Fixed lazy iterator
This commit is contained in:
parent
0eaa9d04b8
commit
b87a2f4575
1 changed files with 1 additions and 1 deletions
|
|
@ -24,7 +24,7 @@ impl Genome {
|
||||||
|
|
||||||
let mut graph = Graph::<Gene,()>::new();
|
let mut graph = Graph::<Gene,()>::new();
|
||||||
let gene_indicies = nodes.into_iter().map(|gene|{graph.add_node(gene)}).collect::<Vec<NodeIndex>>();
|
let gene_indicies = nodes.into_iter().map(|gene|{graph.add_node(gene)}).collect::<Vec<NodeIndex>>();
|
||||||
edges.into_iter().map(|(node_a,node_b)|graph.add_edge(gene_indicies[node_a], gene_indicies[node_b], ()));
|
edges.into_iter().for_each(|(node_a,node_b)|{graph.add_edge(gene_indicies[node_a], gene_indicies[node_b], ());});
|
||||||
|
|
||||||
return Ok(Self {
|
return Ok(Self {
|
||||||
graph
|
graph
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue