Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QMHTMY/RustBook
/ remove_front
Method
remove_front
code/chapter03/deque.rs:39–45 ·
view source on GitHub ↗
从队首移除数据
(&mut self)
Source
from the content-addressed store, hash-verified
37
38
// 从队首移除数据
39
fn remove_front(&mut self) -> Option<T> {
40
if self.size() > 0 {
41
self.data.pop()
42
} else {
43
None
44
}
45
}
46
47
// 从队尾移除数据
48
fn remove_rear(&mut self) -> Option<T> {
Callers
nothing calls this directly
Calls
2
size
Method · 0.45
pop
Method · 0.45
Tested by
no test coverage detected