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