Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QMHTMY/RustBook
/ dequeue
Method
dequeue
publication/code/chapter04/queue.rs:45–51 ·
view source on GitHub ↗
数据出队
(&mut self)
Source
from the content-addressed store, hash-verified
43
44
// 数据出队
45
fn dequeue(&mut self) -> Option<T> {
46
if self.len() > 0 {
47
self.data.pop()
48
} else {
49
None
50
}
51
}
52
53
// 以下是为队列实现的迭代功能
54
// into_iter: 队列改变,成为迭代器
Callers
1
basic
Function · 0.45
Calls
2
len
Method · 0.45
pop
Method · 0.45
Tested by
no test coverage detected