As a Rust noob, I think this is the simplest way to stop string allocations for the indentation, but I'd love to know if there is a better way to do this. I believe .collect::<String>() in the old code was causing a String allocation, and I think a simplified version that I almost went with (print!("{}", " ".repeat(indent));) would do the same thing, so I think this PR should be sufficient.
As a Rust noob, I think this is the simplest way to stop string allocations for the indentation, but I'd love to know if there is a better way to do this. I believe
.collect::<String>()
in the old code was causing a String allocation, and I think a simplified version that I almost went with (print!("{}", " ".repeat(indent));
) would do the same thing, so I think this PR should be sufficient./cc @jdm