You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-07-04 13:50:28 +02:00
Add return statements to the Fibonacci exercise. (#2576)
At this point in the course, we have not explained return statements. Better to have it set up to avoid questions!
This commit is contained in:
@ -14,10 +14,10 @@ this function panic?
|
|||||||
{{#include exercise.rs:fib}}
|
{{#include exercise.rs:fib}}
|
||||||
if n < 2 {
|
if n < 2 {
|
||||||
// The base case.
|
// The base case.
|
||||||
todo!("Implement this")
|
return todo!("Implement this");
|
||||||
} else {
|
} else {
|
||||||
// The recursive case.
|
// The recursive case.
|
||||||
todo!("Implement this")
|
return todo!("Implement this");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user