Simplest way to write "FizzBuzz" in Rust Can you write an a simpler Rust fizzbuzz program than I have? Use my output or the spec:


  Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.


to write your program. I want to see if it's possible to write an even simpler program.

fn main() {
    for i in 1..102 {
        match i {
            i if (i % 15 == 0) =&gt; { println!("{:?}", "FizzBuzz") },
            i if (i % 3 == 0) =&gt; { println!("{:?}", "Fizz") },
            i if (i % 5 == 0) =&gt; { println!("{:?}", "Buzz") },
            _ =&gt; { println!("{:?}", i) },
        }
    }
}
I think that match is better, you just do not know how to cook it ;)

fn main() {
    for i in 1..102 {
        match (i%3, i%5) {
            (0, 0) =&gt; println!("FizzBuzz"),
            (0, _) =&gt; println!("Fizz"),
            (_, 0) =&gt; println!("Buzz"),
            (_, _) =&gt; println!("{}", i)
        }
    }
}