MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / main

Function main

05_functions/rust/fizzbuzz.rs:1–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1fn main() {
2 let fizz_buzz = |x| {
3 if x % 15 == 0 {
4 println!("FizzBuzz")
5 } else if x % 3 == 0 {
6 println!("Fizz")
7 } else if x % 5 == 0 {
8 println!("Buzz")
9 } else {
10 println!("{}", x)
11 }
12 };
13 for i in 1..16 {
14 fizz_buzz(i)
15 }
16 println!("---");
17 (1..16).into_iter().for_each(fizz_buzz);
18}

Callers

nothing calls this directly

Calls 1

fizz_buzzFunction · 0.50

Tested by

no test coverage detected