Factor Rust code into an ERB template