rust/benches/fibonacci_helper.rs

13 lines
172 B
Rust

#[inline(never)]
pub fn main() {
assert_eq!(fib(10), 55);
}
fn fib(n: usize) -> usize {
if n <= 2 {
1
} else {
fib(n - 1) + fib(n - 2)
}
}