fix: check the rust codes and fix them (#653)

* fix: check the rust codes and fix it

* Update binary_tree_bfs.rs

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
Night Cruising
2023-07-24 22:27:26 +08:00
committed by GitHub
parent 978d3c2ed7
commit fdbe275fc9
18 changed files with 167 additions and 102 deletions
@@ -52,11 +52,12 @@
_count += 1;
}
// 直接遍历列表元素
// 直接遍历列表元素
_count = 0;
for _ in &list {
for _n in &list {
_count += 1;
} // 或者
}
// 或者
// list.iter().for_each(|_| _count += 1);
// let _count = list.iter().fold(0, |_count, _| _count + 1);