mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-28 08:36:11 +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:
parent
536cdf378f
commit
3cca4735c4
@ -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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user