Is there any way to select the value of a constant depending on the generic type?
For example, something like (not valid Rust code):
fn foo<T>() {
let b = match T {
u32 => 0x01234567u32,
u64 => 0x0123456789abcdefu64,
_ => panic!()
}
}
fn main() {
foo::<u32>();
foo::<u64>();
}
This function would be only designed to operate with u16, u32 and u64 types.