Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QMHTMY/RustBook
/ remove_rear
Method
remove_rear
code/chapter03/deque.rs:48–54 ·
view source on GitHub ↗
从队尾移除数据
(&mut self)
Source
from the content-addressed store, hash-verified
46
47
// 从队尾移除数据
48
fn remove_rear(&mut self) -> Option<T> {
49
if self.size() > 0 {
50
Some(self.data.remove(0))
51
} else {
52
None
53
}
54
}
55
56
fn is_empty(&self) -> bool {
57
0 == self.size()
Callers
1
main
Function · 0.45
Calls
2
size
Method · 0.45
remove
Method · 0.45
Tested by
no test coverage detected