Replace deprecated to_owned() with to_vec().