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

Method clear

publication/code/chapter04/linked_list.rs:34–37  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

32 }
33
34 fn clear(&mut self) {
35 self.size = 0;
36 self.head = None;
37 }
38
39 // 新节点总是加到头部,
40 fn push(&mut self, elem: T) {

Callers 1

basic_testFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected