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

Method print_lvec

code/chapter03/lvec.rs:125–131  ·  view source on GitHub ↗

打印 LVec,当然也可以实习 ToString 特性

(&self)

Source from the content-addressed store, hash-verified

123
124 // 打印 LVec,当然也可以实习 ToString 特性
125 fn print_lvec(&self) {
126 let mut curr = self.head.as_ref();
127 while let Some(node) = curr {
128 println!("lvec val: {:#?}", node.elem);
129 curr = node.next.as_ref();
130 }
131 }
132}
133
134fn main() {

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected