MCPcopy 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

mainFunction · 0.45

Calls 2

sizeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected