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

Method contains

publication/code/chapter09/word_ladder.rs:102–108  ·  view source on GitHub ↗
(&self, key: &T)

Source from the content-addressed store, hash-verified

100 }
101
102 fn contains(&self, key: &T) -> bool {
103 for (nbr, _vertex) in self.vertices.iter() {
104 if nbr == key { return true; }
105 }
106
107 false
108 }
109
110 // 添加点
111 fn add_vertex(&mut self, key: &T) -> Option<Vertex<T>> {

Callers 1

add_edgeMethod · 0.45

Calls 1

iterMethod · 0.45

Tested by

no test coverage detected