rust/benches/helpers/fibonacci_helper.rs
Ralf Jung 1326aed02c rustfmt
Except for error.rs, the result there looks rather ugly
2017-08-10 08:48:41 -07:00

9 lines
148 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) }
}