I found the code in a progressive tutorial for Glium that seems to occupy a piece of the whole array:
use std::io::Cursor;
let image = image::load(Cursor::new(&include_bytes!("/path/to/image.png")[..]),
image::PNG).unwrap();
include_bytes!appears to load the given file into memory, and then return the link to it as a static array. Which bothers me, why would you then take a link to a piece of the entire array before passing it to Cursor::new.
source
share