I keep hearing Graphs are hard in Rust? am I doing something wrong?

77 points fsevery 21 comments

I keep hearing how hard building a (safe, idiomatic) Graph abstraction in Rust is, from:

https://github.com/nrc/r4cppp/blob/master/graphs/README.md

https://smallcultfollowing.com/babysteps/blog/2015/04/06/modeling-graphs-in-rust-using-vector-indices/

So I'm assuming there is something very wrong with my naive impl, but I don't see it

https://pastecode.io/s/0gfw7zkb

Creating a cycle is possible (just `graph.connect(&node_b, &node_a)`)

What am I missing?