Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QMHTMY/RustBook
/ remove_front
Method
remove_front
publication/code/chapter04/deque.rs:55–61 ·
view source on GitHub ↗
从队首移除数据
(&mut self)
Source
from the content-addressed store, hash-verified
53
54
// 从队首移除数据
55
fn remove_front(&mut self) -> Option<T> {
56
if self.len() > 0 {
57
self.data.pop()
58
} else {
59
None
60
}
61
}
62
63
// 从队尾移除数据
64
fn remove_rear(&mut self) -> Option<T> {
Callers
1
basic
Function · 0.45
Calls
2
len
Method · 0.45
pop
Method · 0.45
Tested by
no test coverage detected