Skip to content

Commit c85d42a

Browse files
committed
Fix example in docs on documentation
1 parent 89259b3 commit c85d42a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/doc/rustdoc.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Calculates the factorial of a number.
5151
5252
Given the input integer `n`, this function will calculate `n!` and return it.
5353
"]
54-
pub fn factorial(n: int) -> int { if n < 2 {1} else {n * factorial(n)} }
54+
pub fn factorial(n: int) -> int { if n < 2 {1} else {n * factorial(n - 1)} }
5555
# fn main() {}
5656
~~~
5757

0 commit comments

Comments
 (0)