MCPcopy 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

basicFunction · 0.45

Calls 2

lenMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected