MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / add_neighbor

Method add_neighbor

code/chapter08/graph_adjlist.rs:28–30  ·  view source on GitHub ↗
(&mut self, nbr: T, wt: i32)

Source from the content-addressed store, hash-verified

26 }
27
28 fn add_neighbor(&mut self, nbr: T, wt: i32) {
29 self.connects.push((nbr, wt));
30 }
31
32 // 获取相邻的点集合
33 fn get_connects(&self) -> Vec<&T> {

Callers 1

add_edgeMethod · 0.45

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected