You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test_list.rs
    path of file: ./repos/rustler/rustler_tests/native/rustler_test/src
    
    the code of the file until where you have to start completion: use rustler::{Error, ListIterator, NifResult};
use std::panic;

#[rustler::nif]
pub fn sum_list(iter: ListIterator) -> NifResult<i64> {
    // Do nothing and suppress panic message. From https://stackoverflow.com/a/35559417
    panic::set_hook(Box::new(|_info| {}));

    let res: Result
    
pub fn sum_list(iter: ListIterator) -> NifResult<i64> {
    // Do nothing and suppress panic message. From https://stackoverflow.com/a/35559417
    panic::set_hook(Box::new(|_info| {}));

    let res: Result<Vec<i64>, Error> = iter.map(|x| x.decode::<i64>()).collect();

    match res {
        Ok(result) => Ok(result.iter().sum::<i64>()),
        Err(err) => Err(err),
    }
}