]> git.lizzy.rs Git - rust.git/commitdiff
Fix example in docs on documentation
authorDerecho <derecho@sector5d.org>
Wed, 2 Jul 2014 08:53:30 +0000 (10:53 +0200)
committerDerecho <derecho@sector5d.org>
Wed, 2 Jul 2014 08:53:30 +0000 (10:53 +0200)
src/doc/rustdoc.md

index 8199eaea82c683b7cc29489b682e11fa8d9d89db..07a93e58456b94a680378e960193788db994c7b7 100644 (file)
@@ -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() {}
 ~~~