PageRenderTime 6ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/src/test/run-pass/deep.rs

http://github.com/jruderman/rust
Rust | 9 lines | 4 code | 4 blank | 1 comment | 4 complexity | 11558811868719db07f1f5a9d72da6b5 MD5 | raw file
1
2
3
4// -*- rust -*-
5fn f(x: int) -> int {
6    if x == 1 { return 1; } else { let y: int = 1 + f(x - 1); return y; }
7}
8
9fn main() { assert (f(5000) == 5000); }