Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QMHTMY/RustBook
/ add_multi
Method
add_multi
publication/code/chapter10/conshash.rs:52–58 ·
view source on GitHub ↗
批量插入结点
(&mut self, nodes: &[T])
Source
from the content-addressed store, hash-verified
50
51
// 批量插入结点
52
fn add_multi(&mut self, nodes: &[T]) {
53
if !nodes.is_empty() {
54
for node in nodes.iter() {
55
self.add(node);
56
}
57
}
58
}
59
60
// 插入一个结点
61
fn add(&mut self, node: &T) {
Callers
nothing calls this directly
Calls
3
is_empty
Method · 0.45
iter
Method · 0.45
add
Method · 0.45
Tested by
no test coverage detected