pubfnadjacent_product(nums:&[usize])->Option<usize>{nums.windows(2).map(|slice|matchslice{[a,b]=>a*b,_=>unreachable!(),// this could panic at runtime if it could actually be reached}).max()}
which produce identical assembly to each other in release mode (meaning the compiler proves different sized slices unreachable without your help)
Rust
on stable you have the options of instead doing:
or
which produce identical assembly to each other in release mode (meaning the compiler proves different sized slices unreachable without your help)
Generic:
Haha square meters go brr