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

Method get_neighbors

code/chapter08/word_ladder.rs:75–82  ·  view source on GitHub ↗

获取邻点

(&self)

Source from the content-addressed store, hash-verified

73
74 // 获取邻点
75 fn get_neighbors(&self) -> Vec<&T> {
76 let mut neighbors = Vec::new();
77 for (nbr, _wt) in self.neighbors.iter() {
78 neighbors.push(nbr);
79 }
80
81 neighbors
82 }
83}
84
85// 图定义

Callers 1

word_ladderFunction · 0.45

Calls 2

iterMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected