MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / remove_rear

Method remove_rear

publication/code/chapter04/deque.rs:64–70  ·  view source on GitHub ↗

从队尾移除数据

(&mut self)

Source from the content-addressed store, hash-verified

62
63 // 从队尾移除数据
64 fn remove_rear(&mut self) -> Option<T> {
65 if self.len() > 0 {
66 Some(self.data.remove(0))
67 } else {
68 None
69 }
70 }
71
72 // 以下是为双端队列实现的迭代功能
73 // into_iter: 双端队列改变,成为迭代器

Callers 1

basicFunction · 0.45

Calls 2

lenMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected