cargo fmt rust code (#1131)

* cargo fmt code

* Add empty line to seperate unrelated comments

* Fix review

* Update bubble_sort.rs

* Update merge_sort.rs

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
rongyi
2024-03-16 02:13:41 +08:00
committed by GitHub
parent 54ceef3443
commit 7b1094318b
70 changed files with 1021 additions and 836 deletions
@@ -9,7 +9,7 @@ include!("../include/include.rs");
/* Driver Code */
fn main() {
// 初始化列表
let mut nums: Vec<i32> = vec![ 1, 3, 2, 5, 4 ];
let mut nums: Vec<i32> = vec![1, 3, 2, 5, 4];
print!("列表 nums = ");
print_util::print_array(&nums);
@@ -58,9 +58,10 @@ fn main() {
}
// 拼接两个列表
let mut nums1 = vec![ 6, 8, 7, 10, 9 ];
nums.append(&mut nums1); // append(移动) 之后 nums1 为空!
// nums.extend(&nums1); // extend(借用) nums1 能继续使用
let mut nums1 = vec![6, 8, 7, 10, 9];
nums.append(&mut nums1); // append(移动) 之后 nums1 为空!
// nums.extend(&nums1); // extend(借用) nums1 能继续使用
print!("\n将列表 nums1 拼接到 nums 之后,得到 nums = ");
print_util::print_array(&nums);