about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/doc/rustdoc.md2
1 files changed, 1 insertions, 1 deletions
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() {}
 ~~~