You need to add parenthesis to main's parameter declaration.
You can't have an expression like (a, b) = returns_a_tuple() on its own. You need to use a new let statement, or some kind of temporary variable, or even a temporary variable in a new scope so as to drop it when necessary.
function_2 takes a Vec by value, not by reference and therefore trying to call it like so wouldn't work:
function_two(a, b, &mut c, &mut d)
This can be fixed by changing the way that you call the function or by changing the declaration of said function
//Either will work:
fn function_two(
a: Vec<String>,
b: Vec<String>,
list_one: &mut Vec<String>,
map_one: &mut HashMap<u64, Vec<u64>>) -> (Vec<String>, HashMap<u64, Vec<u64>>) {
// do something
(list_one, map_one)
}
//OR
let (a, b) = function_one(list_one);
let (list_one, map_one) = function_two(a, b, list_one, map_one);
But unfortunately this won't work either way! function_one takes a HashMap<String, u64> by value, and will therefore take ownership of it, therefore invalidating it for further use. Either use a reference, like shown in the previous example, or take the sub optimal route of storing a clone in a temporary variable. Note that this is sub optimal because .clone() will copy every one of the Vec's elements. This is even worse, considering that it contains Strings and will therefore require nested calls to buffer copies.
Also, in your function you don't really need to have a mutable reference as your comment suggests that you are just reading from it and not actually modifying it.
let a = 2;
let a = 3;
//Any use of `a` from here on out will have the value 3
In the second time we declare a, we just so happen to name it the same as the first a, and will therefore end up with the second a taking precedence naming-wise.
Yes. I understand that and use it. But how that function returns the same value which itself modifies it in a for loop? Something like
for k in 1..10
{
let (list_one,map_one) = function_two(a,b, &mut list_one, &mut map_one); // I want the list_one to updated on every iteration.
}