mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-12 23:36:06 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user