I tried this code
static HOST_FILE: &'static [u8] = include_bytes!("C:\\Users\\Downloads\\cbimage.png");
fn main() {
let host_str = std::str::from_utf8(HOST_FILE). unwrap();
println!("Hosts are:\n{}", &host_str[..42]);
}
But it shows me an error:
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: Utf8Error { valid_up_to: 66, error_len: Some(1) }', src\main.rs:48:51
stack backtrace