|
Putting the String issue aside, I just wanted to show the beauty of pattern matching. for i in range(1i, 101) {
match (i % 3, i % 5) {
(0, 0) => println!("Fizzbuzz"),
(0, _) => println!("Fizz"),
(_, 0) => println!("Buzz"),
_ => println!("{}", i),
}
}
-- edited: removed `.to_string()`, thanks chrismorgan |