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

Method print_node

publication/code/chapter09/bfs.rs:48–56  ·  view source on GitHub ↗

打印节点

(&self)

Source from the content-addressed store, hash-verified

46
47 // 打印节点
48 fn print_node(&self) {
49 let mut curr = self.first.clone();
50 while let Some(val) = curr {
51 print!("[{}]", &val.borrow().data);
52 curr = val.borrow().next.clone();
53 }
54
55 print!("\n");
56 }
57
58 // 插入节点,RefCell 使用 borrow_mut 修改
59 fn insert(&mut self, data: usize) {

Callers 1

build_graphFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected