I think using `~~~ {.rust}` will make pandoc highlight the codeblocks as Rust.