Skip to content

Fibonacci example doesn't compile because of ; in line 3 #193

@Aloso

Description

@Aloso

The semicolon in line 3 of this example prevents it from compiling:

pub fn fibonacci_n() -> i64 {
    let n = arg();
    fibonacci(n);
}

fn arg() -> i64 {
    5
}

fn fibonacci(n: i64) -> i64 {
    if n <= 1 {
        n
    } else {
        fibonacci(n - 1) + fibonacci(n - 2)
    }
}

P.S. sorry for reporting this in the wrong repo!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions