Skip to content

Commit 53b14f4

Browse files
authored
Merge pull request #1924 from ViggoC/patch-1
Non-tail recursive call note in testcase_linked_list.md
2 parents fbbf20a + 76cac7d commit 53b14f4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/custom_types/enum/testcase_linked_list.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ impl List {
3838
match *self {
3939
// Can't take ownership of the tail, because `self` is borrowed;
4040
// instead take a reference to the tail
41+
// And it'a a non-tail recursive call which may cause stack overflow for long lists.
4142
Cons(_, ref tail) => 1 + tail.len(),
4243
// Base Case: An empty list has zero length
4344
Nil => 0

0 commit comments

Comments
 (0)