Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QMHTMY/RustBook
/ is_adjacent
Method
is_adjacent
publication/code/chapter09/graph_adjlist.rs:153–155 ·
view source on GitHub ↗
判断两个点是否相邻
(&self, from: &T, to: &T)
Source
from the content-addressed store, hash-verified
151
152
// 判断两个点是否相邻
153
fn is_adjacent(&self, from: &T, to: &T) -> bool {
154
self.vertices.get(from).unwrap().adjacent_key(to)
155
}
156
}
157
158
fn main() {
Callers
1
main
Function · 0.45
Calls
2
adjacent_key
Method · 0.45
get
Method · 0.45
Tested by
no test coverage detected