/// Read the contents from file path
Read the contents from file path
Read the contents from file path
fn read_contents_from_path(path_str: &String) -> Result<Vec<u8>, io::Error> {
    let mut buffer: Vec<u8> = Vec::new();
    let file_path = std::path::PathBuf::from(path_str);
    println!("file_to_process: {:?}", file_path);
    let mut file = File::open(file_path)?;
    file.read_to_end(&mut buffer)?;
    drop(file);
    Ok(buffer)
}
fn read_contents_from_path ( path_str : & String ) -> Result < Vec < u8 > , io :: Error > { let mut buffer : Vec < u8 > = Vec :: new ( ) ; let file_path = std :: path :: PathBuf :: from ( path_str ) ; println ! ( " " file_path ) ; let mut file = File :: open ( file_path ) ? ; file . read_to_end ( & mut buffer ) ? ; drop ( file ) ; Ok ( buffer ) }
Read the contents from file path
Read the contents from file path
path_str
&String