Currently I have the following
const WIDTH : u16 = 1920;
const HEIGHT: u16 = 1080;
const PIXELS : usize = 1920 * 1080;
It would be nicer to have something like
const WIDTH : u16 = 1920;
const HEIGHT: u16 = 1080;
const PIXELS : usize = usize::from(WIDTH) * usize::from(HEIGHT);
But this will not compile. I assume this is because const are compile time variables and can't rely on the execution of usize::from. Is there an alternative?