Number to vector of its digits
I would call this "more idiomatic" but I'm still not satisfied with it. Rust uses Iterators in a lot of ways, e.g. look at this implementation:

pub fn num_digits(num: i32) -&gt; Vec&lt;i32&gt; {
    let mul = if num &lt; 0 { -1 } else { 1 };
    num.to_string()
        .chars()
        .filter_map(|x| x.to_digit(10))
        .map(|x| (x as i32) * mul)
        .collect()
}


The mul variable is just for determining if you want negative or positive numbers.

Because i32 implements the Display trait you can call to_string on it, which will give you a String representation of the i32.
Next is just iterating of the characters of the String and trying to convert them to a digit. - will be ignored, because it is not a digit and filter_map will filter all Results, that will return a Err. The next thing is to convert the numbers to a i32 (because to_digit gives an u32) and either making them negative if the original number was negative or staying positive.

collect will put all the numbers into a collection, in this case a Vec because the type can be deduced by Rust (because of the return type)