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

Method remove_multi

code/chapter09/conshash.rs:67–73  ·  view source on GitHub ↗

批量删除结点

(&mut self, nodes: &[T])

Source from the content-addressed store, hash-verified

65
66 // 批量删除结点
67 fn remove_multi(&mut self, nodes: &[T]) {
68 if !nodes.is_empty() {
69 for node in nodes.iter() {
70 self.remove(node);
71 }
72 }
73 }
74
75 fn remove(&mut self, node: &T) {
76 assert!(!self.ring.is_empty());

Callers

nothing calls this directly

Calls 3

is_emptyMethod · 0.45
iterMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected