I tried to implement fizzbuzz in Rust and failed with some arcane error:
fn main() { let mut i = 1; while i < 100 { println!(
The problem is that if i % 3 == 0 { "Fizz" } returns either unit () or &'static str. Change the if expressions to return the same type in both cases, for example by adding a else { "" }.
if i % 3 == 0 { "Fizz" }
()
&'static str
else { "" }