Reason of the error expected (), found struct `std::vec::Vec` in Rust?
问题 I am new to rust programming. I wanted to implement merge sort with recursion. Here is my code: fn merge(a: &mut Vec<u32>, b: &mut Vec<u32>) -> Vec<u32> { let mut temp: Vec<u32> = Vec::new(); println!("The digit is {}", a[0]); while a.len() > 0 && b.len() > 0 { if a[0] > b[0] { temp.push(a[0]); a.pop(); } else { temp.push(b[0]); b.pop(); } } while a.len() > 0 { temp.push(a[0]); a.pop(); } while b.len() > 0 { temp.push(b[0]); b.pop(); } temp } fn merge_sort(v: &mut Vec<u32>) -> Vec<u32> {