From: Derecho Date: Wed, 2 Jul 2014 08:53:30 +0000 (+0200) Subject: Fix example in docs on documentation X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=c85d42a3054e2859aac67b143485f6cd8a0693e9;p=rust.git Fix example in docs on documentation --- diff --git a/src/doc/rustdoc.md b/src/doc/rustdoc.md index 8199eaea82c..07a93e58456 100644 --- a/src/doc/rustdoc.md +++ b/src/doc/rustdoc.md @@ -51,7 +51,7 @@ Calculates the factorial of a number. Given the input integer `n`, this function will calculate `n!` and return it. "] -pub fn factorial(n: int) -> int { if n < 2 {1} else {n * factorial(n)} } +pub fn factorial(n: int) -> int { if n < 2 {1} else {n * factorial(n - 1)} } # fn main() {} ~~~