Format with rustc --pretty

We need a proper code formatting tool for Rust
Move topic reading into its own function to reduce rightward drift