fiblib 0.1.0

very simple fibonacci sequence generator - returns vector of nth size
Documentation
1
2
3
4
5
6
7
8
9
10
pub fn fib(n: i32) -> Vec<i32> {
    let mut nums: Vec<i32> = vec![];
    let (mut a, mut b) = (0, 1);
    while a < n {
        nums.push(a);
        (a, b) = (b, a + b);
    }

    nums
}