Advent of Code 2019 Day 2 in Rust
Some things you could do :


remove these "add" and "multiply" functions 
group operations when you read the file and when you split the input
use iterators on your splitted input
assign using the match statement
declare all your variables at once (it's debatable, but if you find it easier to read then go for it ! )
put info in your error message for the code (although it might not help much if you have a bug here, I admit)


It could look something like :

use std::fs;

fn run_program(memory: &amp;mut Vec&lt;i32&gt;) -&gt; i32 {
    for i in (0..memory.len()).step_by(4) {
        let (address_a, address_b, pos) = (memory[i + 1] as usize, memory[i + 2] as usize, memory[i + 3] as usize);
        memory[pos] = match memory[i] {
            1 =&gt; {
                memory[address_a] + memory[address_b]
            }
            2 =&gt; {
                memory[address_b] * memory[address_b]
            }
            99 =&gt; {
                return memory[0];
            }
            c =&gt; panic!("Invalid command value : {}", c)
        }
    }
    //return result of the program stored at address 0
    memory[0]
}

fn main() {
    let codes:Vec&lt;i32&gt; = fs::read_to_string("input.txt")
        .expect("Something went wrong reading the file")
        .split(',')
        .filter_map(|v| v.parse::&lt;i32&gt;().ok())
        .collect();

    let target_value = 19690720;

    for noun in 0..100 {
        for verb in 0..100 {
            let mut current_memory = codes.clone();
            //init noun and verb
            current_memory[1] = noun;
            current_memory[2] = verb;

            let current_result = run_program(&amp;mut current_memory);

            if current_result == target_value {
                println!("Target value reached, noun: {}, verb {}", noun, verb);
                println!("Result = {}", 100*noun + verb);
                break;
            }
        }
    }
}


Note : the ".ok()" filter might be dangerous in your stream ! I had a problem for day 5 where I had used wrong types for the instructions, and when the parsing failed they were discarded : I was missing instructions in my "codes" Vec !
You might want to fail if this happens instead, it's way easier to debug...