#!/friends/bin/rustscript cd /tmp cat <<'EOF' > /tmp/$$.rs fn main() { let result = (1..31).map(|n| match (n % 3, n % 5) { (0, 0) => "FizzBuzz".to_owned(), (0, _) => "Fizz".to_owned(), (_, 0) => "Buzz".to_owned(), _ => n.to_string() }); for r in result { println!("{}", r); } } EOF rustc $$.rs && ./$$