获取相邻的点集合
(&self)
| 33 | |
| 34 | // 获取相邻的点集合 |
| 35 | fn get_neighbors(&self) -> Vec<&T> { |
| 36 | let mut neighbors = Vec::new(); |
| 37 | for (nbr, _wt) in self.neighbors.iter() { |
| 38 | neighbors.push(nbr); |
| 39 | } |
| 40 | |
| 41 | neighbors |
| 42 | } |
| 43 | |
| 44 | // 返回到邻点的边权重 |
| 45 | fn get_nbr_weight(&self, key: &T) -> &i32 { |
no test coverage detected