Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QMHTMY/RustBook
/ len
Method
len
code/chapter05/hashmap.rs:128–137 ·
view source on GitHub ↗
(&self)
Source
from the content-addressed store, hash-verified
126
}
127
128
fn len(&self) -> usize {
129
let mut length = 0;
130
for d in self.slot.iter() {
131
if &0 != d { // 槽数据不为 0,表示有数据,length 加 1
132
length += 1;
133
}
134
}
135
136
length
137
}
138
}
139
140
fn main() {
Callers
9
interpolation_search
Function · 0.45
sequential_search
Function · 0.45
ordered_sequential_search
Function · 0.45
ordered_sequential_search_pos
Function · 0.45
sequential_search_pos
Function · 0.45
binary_search1
Function · 0.45
binary_search2
Function · 0.45
binary_search
Function · 0.45
exponential_search
Function · 0.45
Calls
1
iter
Method · 0.45
Tested by
no test coverage detected