summaryrefslogtreecommitdiffstats
path: root/src/load_file.rs
blob: 0fd1541bcf4ae9fc315ef1e8388f1cc8625f4702 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
use std::fs::File;
use std::io::Read;

pub fn load_file_vec(path: &String) -> std::io::Result<Vec<u8>>
{
    let mut file = File::open(path)?;
    let mut data = Vec::new();

    file.read_to_end(&mut data)?;

    Ok(data)
}