summaryrefslogtreecommitdiff
path: root/exercises/03_if
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-05-22 15:16:50 +0200
committermo8it <mo8it@proton.me>2024-05-22 15:16:50 +0200
commiteafb157d60ee46e95e2b54ec75b33180a838b0c5 (patch)
tree9920ac8ace97ec72b19687af80283f4e5d0cb148 /exercises/03_if
parent7cdf6b79429428e944b440eb713e711d844a92d7 (diff)
if2 solution
Diffstat (limited to 'exercises/03_if')
-rw-r--r--exercises/03_if/if2.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/exercises/03_if/if2.rs b/exercises/03_if/if2.rs
index 1b65596..593a77a 100644
--- a/exercises/03_if/if2.rs
+++ b/exercises/03_if/if2.rs
@@ -1,6 +1,4 @@
-// Step 1: Make me compile!
-// Step 2: Get the bar_for_fuzz and default_to_baz tests passing!
-
+// TODO: Fix the compiler error on this function.
fn foo_if_fizz(fizzish: &str) -> &str {
if fizzish == "fizz" {
"foo"
@@ -13,13 +11,15 @@ fn main() {
// You can optionally experiment here.
}
-// No test changes needed!
+// TODO: Read the tests to understand the desired behavior.
+// Make all tests pass without changing them.
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn foo_for_fizz() {
+ // This means that calling `foo_if_fizz` with the argument "fizz" should return "foo".
assert_eq!(foo_if_fizz("fizz"), "foo");
}