crayon-syntax-highlighter/util/sample/rust.txt
2019-08-30 19:30:19 +02:00

9 lines
403 B
Plaintext

/* The branches in this function exhibit Rust's optional implicit return
values, which can be utilized where a more "functional" style is preferred.
Unlike C++ and related languages, Rust's `if` construct is an expression
rather than a statement, and thus has a return value of its own. */
fn recursive_factorial(n: int) -> int {
if n <= 1 { 1 }
else { n * recursive_factorial(n-1) }
}