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

Method clear

publication/code/chapter04/deque.rs:30–32  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

28 }
29
30 fn clear(&mut self) {
31 self.data = Vec::with_capacity(self.cap);
32 }
33
34 // Vec 末尾为队首
35 fn add_front(&mut self, val: T) -> Result<(), String> {

Callers 1

basicFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected