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

Function fizz_buzz

0f_debugging/rust/fizzbuzz.rs:1–8  ·  view source on GitHub ↗
(x: i32)

Source from the content-addressed store, hash-verified

1fn fizz_buzz(x: i32) -> String {
2 match (x % 3, x % 5) {
3 (0, 0) => "FizzBuzz".into(),
4 (0, _) => "Fizz".into(),
5 (_, 0) => "Buzz".into(),
6 (_, _) => format!("{}", x),
7 }
8}
9
10fn vec_fizz_buzz(n: i32) -> Vec<String> {
11 let mut v = Vec::new();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected