]> git.lizzy.rs Git - rust.git/blobdiff - src/doc/rustdoc.md
Fix example in docs on documentation
[rust.git] / 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() {}
 ~~~